MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks. MATLAB can be used when performing tasks such as signal processing and communications, image and video processing, computational finance, and computational ... ...

learn more… | top users | synonyms

1
vote
1answer
32 views

Integer programming in MATLAB - all different solutions [on hold]

I have a relatively simple minimisation problem. I have to minimise a linear function with many variables (more than 20), and I would like all the solutions to be different and in set $ x \in ...
1
vote
1answer
40 views

Attempt to solve a matrix (counterbalancing) problem computationally gives “spooky” result: why?

This question is posted on the mathematics section of stackexchange because my uneducated guess is that the answer involves some basic mathematical principles, possibly in the domain of linear ...
0
votes
0answers
14 views

Help in plotting the Z-transform and Fourier Transform of the following Sequences.

I'm taking Digital Signal Processing class at the moment and while I believe I understand the theory behind the z-transform and fourier transform, in this case DFT and DTFT, I'm stuck as to how to ...
0
votes
0answers
16 views

Distance Geometry Problem (DGP) Programming Language Recommendation

We have been studying DGPs in clinic recently and I was hoping I might be able to get recommendations for computing languages in the processing of large network solutions. Specific computations ...
8
votes
1answer
4k views

Expected Value and Variance of Monte Carlo Estimate of $\int_{0}^{1}e^{-x}dx$

Given the integral: $I=\int_{0}^{1}e^{-x}dx$, use standard Monte Carlo with 1000 random numbers and repeat the simulation 1000 times. (a) What is the expected value and variance of the simple Monte ...
1
vote
1answer
418 views

How to solve nonlinear constrained optimization in Matlab?

I have to solve a nonlinear constrained function in matlab, and I am not familiar with it's commands. the problem is: minimize $E(b,c)$ constraints: $k1< c\sqrt{b}< k2 ; c/6>k3$ Note: E(b,c) ...
0
votes
1answer
990 views

Autocorrelation and spectral density in MATLAB

This question is twofold. We have an LTI system that is a first degree Butterworth LP filter with the power TF where fu = 110Hz and ...
-2
votes
0answers
24 views

Gaussian Elimination vs matrix inversion [on hold]

Why Gaussian Elimination is better than matrix inversion in therms of FLOPS? Also how LU decomposition improves the shifted inverse power method?
1
vote
1answer
23 views

Quadratic programing problem and MATLAB

I have a little problem with quadratic programing problem: ${\bf v}^T \Sigma {\bf v} \rightarrow min $, and constrains are $ {\bf v}^T \mu = \mu_*, {\bf v}^T {\bf 1 }= 1, 0 \leq {\bf v}. $ Where ...
0
votes
1answer
753 views

One strange way to generate b-spline base

I am trying to use curve fitting under Matlab. There are two kinds of spline in Matlab: piecewise polynomials and b-spline. For b-spline, we know that the basic functions can be derived by means of a ...
2
votes
1answer
34 views

why does matlab give me a negative number?

I have the following problem A steel company has four different types of scrap metal (called Typ-1 to Typ-4) with the following compositions per unit of volume They need to determine the volumes ...
0
votes
1answer
46 views

MATLab help involving Linear Algebra.

I am trying to understand what is happening here.. A = floor(10*rand(3)); b = sum(A')'; z = ones(3,1); If I solve the system $Ax = b$, the solution is identical ...
-1
votes
0answers
60 views

Solving equation using Newton's Method

Use Newton's method to solve the equation $$f(x)=\frac{1}{x}+\ln{x}-2=0$$ for $x>0$. Characterize the convergence as linear or quadratic by tabulating the number of correct bits at each step of the ...
0
votes
1answer
28 views

Relating regression to projection?

I recently learned that one can think of regression as a projection of a vector in a high dimension space onto the other vector. I tried implementing this and got it to work: ...
2
votes
1answer
1k views

eigenvector centrality for directed graphs

I need to compute eigenvector centrality for a directed graph: It's a network of international trade of goods, so obviously what country A imports from B (= B exports in A) is not what country B ...
1
vote
1answer
598 views

Covariance matrix of two matrices- how to calculate

In maximum covariance analysis, to extract correlated columns, it is asked to calculate the covariance matrix. For two vectors, corvariance matrix is understood, COV(v1,v2) = v1*v2' How do I ...
0
votes
0answers
20 views

If and Else of time in Matlab [closed]

I just want to ask a matlab code (if-else statement) of time. Example is if 7AM-5PM output is 1 .. the rest would have an output of 0. Thanks
-1
votes
0answers
17 views

Matlab code date and time controller [closed]

I am struggling a lot in making the code for my controller. I successfully made the code wherein the input is the time and day of what my computer has but what I need next will be the controller in ...
0
votes
1answer
585 views

Overlaying scatter points over world map in MATLAB

I am facing difficulty overlaying lightning location data over a region of the world map. I have lightning location data where the first column contains longitude and the second column latitude. I ...
0
votes
2answers
1k views

How to calculate the hessian of a matrix function

I am estimating a model minimizing the following objective function, $ M(\theta) = (Z'G(\theta))'W(Z'G(\theta))$ $Z$ is an $N \times L$ matrix of data, and $W$ is an $L\times L$ weight matrix, ...
0
votes
1answer
23 views

Failed attempts at fitting nonlinear Hill function (biochemistry) to data

I am trying to fit some data in Matlab to a Hill function of the form $y = \dfrac{1}{1+(K/r)^n}.$ I have data for $r,y$ and I need to find $K,n$. I have tried following the approach shown here in ...
1
vote
1answer
465 views

MATLAB determining elementary matrices for LU decomposition

I am confused by this question I am studying for MATLAB practice.
0
votes
1answer
5k views

Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft

Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft. Greetings I'm trying to rebuild a signal from the frequency, amplitude, and phase obtained after I do ...
1
vote
1answer
22 views

Accelerating linear solve in MATLAB for a specific type of matrices

Inside a DG solver (so far 1D) I need to solve a linear system of equations multiple times. The order of the system is rather small ($N=10..20$). I need to solve the system $Ax=b$, where $A$ is the ...
0
votes
1answer
18 views

Matlab: function gradient and Hessian in the same function

Implement a Matlab function for computation of $ f(x),\nabla f(x),\nabla^2 f(x) $ The function must have the interface: function [f,df,d2f] = FunEx1(x) where $f(x)=f=x^2-2x+3xy+4y^3;$ I tried: ...
0
votes
2answers
2k views

How to define in Matlab the function $f(x,y)=\left ( xy,x-y^2,3x-2y \right )$

I need to define the function $f(x,y)=\left ( xy,x-y^2,3x-2y \right )$, how can I do this in Matlab? Thanks!
-1
votes
1answer
16 views

Logspace() in Matlab [closed]

In Matlab , Logspace() Generate logarithmically spaced vector . But what do we mean by them ? Earlier , I used to think that they are just equal spaced and their 10th power is returned . Like here : ...
1
vote
1answer
260 views

Numerical solution of non-linear differential equation with MATLAB

I need some information to know if I can solve a nonlinear integral equation with terms $ u_{x} $ , $ u_{x}.u_{y} $ , $ u_{xx} $ , $ u_{xy} $ $u_{yy} $ $ u_{x}^{2} $ $ u_{y} ^{2} $ By numerical ...
-1
votes
1answer
28 views

Solving linear equations in Matlab

I am trying to solve the problem $Ac = b$ but I am having difficulty figuring out how to set it up. I thought multiplying by ${\rm e}$ would remove the $\ln$ but I guess I forgot my basic math. My ...
1
vote
1answer
727 views

Determining the value of ECDF at a point using Matlab

I have a data $X=[x_1,\dots,x_n].$ In Matlab, I know by using [f,x]=ecdf(X) plot(x,f) we will have the empirical distribution function based on $X$. Now, if ...
0
votes
0answers
10 views

Correlate normal shocks

I am trying to generate some random standard normal variables and correlate them In particular I want: $$ \bf Y \sim \mathcal N(0, \Sigma) $$ where $\textbf{Y} = (Y_1,\dots,Y_n)$ is the vector I ...
0
votes
0answers
5 views

isotropic volume from 3D dicom data

Iam working with CTA volume having dimensions 512*512*304. How I can convert the volume into isotropic form having axial size of 256*256.I have gone through ...
1
vote
1answer
656 views

Heuman Lambda Function in MATLAB

I'm trying to implement the Heuman Lambda function in MATLAB, but i'm having problems getting a correct answer. The Heuman Lambda Function is: $$ \Lambda_0(\beta,k) = \frac{2}{pi}[E(k)F(\beta,k') + ...
3
votes
2answers
2k views

How I can get coefficients matrix in MATLAB from the set of linear equations?

I am working in MATLAB and having problem in extraction of coefficients out of my set of symbolic linear equations. Equations are as such ...
0
votes
0answers
30 views

Coding a bisection algorithm using matlab (numerical analysis)

To code the bisection algorithm. We assume that f at the two end-points a and b are of different signs. We will return the approximated solution when $b_{n}$ − $a_{n}$ < 2ε or when we have found ...
0
votes
1answer
27 views

Overflow an integer sequence at a given value

Sorry, the question seems to be extremely simple, but I fail to find an answer. I have an integer sequence 1, 2, 3, ... 8 I would like to convert it to ...
0
votes
0answers
12 views

Getting confidence interval from wblfitc matlab function

I am using the matlab function wblfitc which can be found here: http://www.mathworks.com/matlabcentral/fileexchange/38226-fit-distributions-to-censored-data It gives me an estimation for the ...
3
votes
1answer
696 views

Plotting discrete time signals involving sumations in matlab.

Many of the examples I've encountered while looking for an answer are simple functions that do not involve summations. Suppose I have the following function; ...
0
votes
0answers
8 views

Lax-Wendroff: Computing $\partial_{t}^{3}u$ given $u_{t}=a_{1}u_{xx}+a_{2}g(t)u_{x}^{2}$

I want to use the Lax-Wendroff method to $u_{t}=a_{1}u_{xx}+a_{2}g(t)u_{x}^{2}$, for g smooth function and $a_{i}$ constants. . That requires computing $u_{ttt}$ in terms of derivatives in x. Is ...
0
votes
0answers
15 views

solving byp system in matlab

I have problem to solve this in MATLAB. The equation already in first order system, yet I still confused to write the code and solve it. Or this equation cant be solved by using bvp4c perhaps? ...
0
votes
0answers
20 views

Solving Hyperbolic PDE using MATLAB (finite difference Method)

I am given the PDE $u_t + u_x = 0, x \in (-2,3), t > 0$ with initial condition $ u(x,0) = 1 - |x|$ when $|x| \leq 1$ and $u(x,0) = 0$ when $|x| \geq 1$. With boundary condition $u(-2,t) = 0$. How ...
0
votes
0answers
19 views

Finite difference scheme for piecewise domain heat equation

We have piecewise heat equation $u_{t}(x,t)=\left\{\begin{matrix} D_{1}u_{xx}(x,t) &x\in(0,1) \\ D_{2}u_{xx}(x,t) & x\in (1,2)\end{matrix}\right.$, with IC: $u(x,0)=2x+1$ and BC : ...
2
votes
1answer
5k views

Solve a second order DEQ using Euler's method in MATLAB

I need to solve the equation below with Euler's method: $$y''+ \pi ye^{x/3}(2y' \sin(\pi x)+\pi y\cos (\pi x)) = \frac{y}{9}$$ for the initial conditions $y(0)=1$, $y'(0)=-1/3$ So I know I ...
0
votes
1answer
457 views

Inverse Quadratic Interpolation and the secant method

I am currently completing a maths project that aims to approximate the roots of functions using MATLAB. The two root finding methods that I have used are inverse quadratic interpolation and the ...
3
votes
4answers
9k views

Understanding Fourier transform example in Matlab

I'm studying about Fourier series and transform and I get confused with the following Matlab example of Fourier transformation: ...
0
votes
1answer
912 views

convex hull function in matlab

Is there any way to compute the convex hull of a finite set of points in Matlab and gives the half-space representation as its result? I usually use a toolbox called MPT developed at ETHZ Zurich, but ...
2
votes
1answer
573 views

Matlab: need help with optimization

I am trying to minimize the objective function over [x(1),x(2)]: exp(x(1))*(4*x(1)^2+2*x(2)^2+4*x(1)*x(2)+2*x(2)+1)+b subject to constraint ...
0
votes
0answers
19 views

Least n for which a family of vectors is linearly dependent

I want to code in MATLAB a function find the least integer $n$ for which a family of vectors are independent. $T$ is a linear operator, $v$ is a vector in $\mathcal{H}$. The family in question is ...
1
vote
2answers
58 views

Exponential Integral difference between Maple and Matlab

I try to calculate this exponential integral: $$\int_0^1 \exp(\exp(-s))ds.$$ I obtained different results in Maple: and Matlab: Which is correct?
0
votes
1answer
440 views

Gaussian distribution and its parameters

I need to learn more about Gaussian distribution and given a set of data, plot a Gaussian distribution of it. Using the following code sample, could you please tell me how I can plot a Gaussian ...