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
80 views

Find an expression of the direction field

I have a directions vector field which I got empirically using quiver in Matlab. I want to find some analytical expressions that might work at least in part of the direction field. How can I ...
1
vote
1answer
135 views

Inverse problem with 4D and 2D matrix

I was trying to solve an inverse problem in mechanics and computing it in Matlab, when i found something unknown for me, and so I haven't any idea on how to compute it. Basically, after ...
1
vote
0answers
115 views

directed simple graph, all paths from node $ v_0 $ to an other node $ v $, MATLAB

consider a directed simple graph $ G=(V,E) $ with $ V=\lbrace v_0,v_1,\ldots,v_k \rbrace $ and adjacency matrix $ A=(a_{ij}) $, where $ a_{ij}=1 $ means, that there is an arc from node $ v_i $ to node ...
0
votes
0answers
41 views

compute a certain maximum in MATLAB

let $ C \in \mathbb{N} $ and $ c_1>c_2>\ldots>c_k \in \mathbb{N} $ with $ C>c_1 $ and $ c=(c_1,c_2,\ldots,c_k)^\top \in \mathbb{N}^k $, where $ \mathbb{N} $ are the natural numbers without ...
1
vote
1answer
52 views

Automatic defining global variables in MATLAB

How could I define a set of variables automatically in MATLAB. For example: kt1 to kt_n*(2*n+1) ...
1
vote
2answers
269 views

L1 regularized SVM in Matlab

Minimizing the following SVM formulation \begin{align} \arg\min_{\mathbf{w}}\frac{1}{2}\|\mathbf{w}\|^2_2 \\ \text{subject to } \quad y_i(\mathbf{w}\cdot\mathbf{x_i}) \ge 1 \end{align} can be done ...
0
votes
0answers
68 views

Is it possible to get two different fits, both using a single term Gaussian model?

I am using Matlab to fit Gaussian/normal distributions to image intensities that are binned by 25. I recently used the "hisfit" function and then used cftool > Gaussian > single term (equation is ...
0
votes
3answers
67 views

Generating a Triangular Matrix via a Vector MATLAB

How do I generate an arbitrary (size n) triangular matrix with a vector? For example: A=[1;2;3;4;5;6;7;8;9;10]; And the answer should be: B=[1,2,3,4; 0,5,6,7; 0,0,8,9; 0,0,0,10] or ...
-1
votes
1answer
109 views

Syntax of Upper Incomplete Gamma Function in MATLAB [closed]

How is the Upper Incomplete Gamma Function implemented in MATLAB? I am confused about the syntax and it is not properly explained in MATLAB documents. If the limit is from x to $\infty$ , and i have ...
2
votes
1answer
58 views

Strange matrix multiplication behavior in Matlab

I noticed strange behavior of some calculations in Matlab. Matlab code listing: ...
2
votes
1answer
698 views

Are “constrained linear least squares” and “quadratic programming” the same thing?

A Quadratic Programming problem is to minimize: $f(\mathbf{x}) = \tfrac{1}{2} \mathbf{x}^T Q\mathbf{x} + \mathbf{c}^T \mathbf{x}$ subject to $A\mathbf{x} \leq \mathbf b$; $C\mathbf{x} = \mathbf d$; ...
0
votes
1answer
53 views

Top and bottom power spectral density of a height profile

Imagine I have a simple 1D height profile which is NOT symmetric. Now, what is truly important for me is to know what are the frequency content of the top profile (i.e. a cut profile above the ...
1
vote
1answer
432 views

Matlab, how to know time step size in the plot or how can I get the output of time step size?

Since I am using matlab ode23s solver, it contains two matlab files. One contains the differential equations and another contains plotting and to run the m-files. The code are working perfectly. Now I ...
0
votes
3answers
3k views

How to define a piecewise function in matlab?

I want to calculate the convolution sum of the continuous unit pulse with itself, but I don't know how I can define this function $$ \delta(t) = \begin{cases} 1, 0 \le t \lt 1 \\ 0, otherwise ...
0
votes
0answers
88 views

Substitution in Matlab (Iteration Process)

I am facing some problem in iterating my equations. Basically, here how it should work. A(i)= x1*B(i) + x2*B(i-1) B(i)= x3*A(i) + x4*A(i-2) A(i)= x5*B(i-1) + x6*A(i-2) B(i)= x7*B(i-1) + x8*A(i-2) ...
1
vote
1answer
78 views

Relative error when computing derivatives via FFT

I want to compute a discrete derivative via the FFT. This amounts to multiplication by the wave number in Fourier space, as detailed in the stack exchange answer here. When I increase the ...
0
votes
1answer
20 views

Iterating substitution question (Matlab)

I have four relations between A and B as below. A(i)= B(i) + B(i-1) B(i)= A(i) + A(i-2) A(i)= B(i-1) + A(i-2) B(i)= B(i-1) + A(i-2) Assume i is 7 and A(7),A(0),B(7),B(0) are known. (Just for ...
2
votes
4answers
124 views

$(-1)^{0.2}=0.8090 + 0.5878i$ how can this be?

I'm working on a numerical analysis project (working with matlab a lot) and I noticed that when I ask for matlab to compute the exponent of a negative number, it gives wrong output when the exponent ...
0
votes
1answer
203 views

How to compute the bivariate normal distribution CDF with rho in Matlab?

I want to compute the bivariate normal distribution CDF with rho in matlab, but I just find mvncdf function http://www.mathworks.com/help/stats/mvncdf.html. I do not know how to use it and how to use ...
1
vote
1answer
627 views

Surface fitting

I do not need a complete answer but just some advice. I have a sparse matrix of points in a volume. I know a surface passing by these points exists and this surface is mostly flat and relatively ...
0
votes
0answers
244 views

Matrix inverses on matlab: are pinv and ./ related?

I faced with two actual implementations of the same problem, and need some help to find which one is correct. Let K be an non-square $m \times n$ matrix (a product of two eigenvalues vectors), B an ...
1
vote
0answers
878 views

The phase portrait of a second order of nonlinear system using matlab

I have the following system $$ \ddot{x} + 0.6\dot{x} + 3x + x^{2} = 0 $$ In the book I'm reading, the phase portrait of the nonlinear system for the aforementioned equation is I would like to ...
0
votes
1answer
91 views

symbolic definite integral using matlab

I have this function $$ \frac{di}{dt} = - \frac{R}{L} i $$ I know the solution which is $$ i(t) = i_{0} e^{- \frac{R}{L} (t-t_{0})} $$ I would like to get the same solution by using Matlab. How can ...
1
vote
0answers
114 views

implicit non-linear equations with complex variables

I am trying to understand a methodology for solving implicit non-linear equations with complex variables. I would like to solve for z1 below where z2 is known. Also both z1 and z2 are complex ...
0
votes
1answer
46 views

Inequality involving fractions and several variables

Based on my previous two questions (that failed), I am trying once more. What are some simplified conditions for which: ...
1
vote
0answers
62 views

Time needed to algebraically solve system of $15$ nonlinear equations with parameters

How long can I expect it will take to algebraically solve a system of $15$ nonlinear equations (without any numbers, only parameters), if I feed it into a computing software? I'm asking for symbolic ...
-1
votes
1answer
58 views

correlation matching audio files peak position

if i cross correlate an audio file with itself (which means there is no delay or difference), the peak position should be a zero or at the center of the cross correlation? that is really confusing ...
0
votes
0answers
127 views

How to get this formula in fv tool (Matlab)?

I have this formula $$\frac{z^{-4799}-0.742}{0.742z^{-4799}}$$ I know that the fv tool can plot diagrams from this but I don't know how to get them in there. Any tips?
0
votes
1answer
84 views

Matlab: integrate function in dependence of a parameter

I am a matlab beginner and can not spot the mistake in the following code: ...
1
vote
1answer
241 views

Generate random numbers with a modified PERT distribution

I want to generate random numbers based on the modified PERT distribution. The modified PERT distribution is a special case of the beta distribution and is defined as: $$f_X(x) = ...
0
votes
1answer
42 views

Anyone recognize this pattern? Plotting relationship between two parameters and their response.

First time asking a question here so hopefully I can provide enough information to you guys without explaining more than necessary. I'm doing some amateurish numerical analysis in MATLAB on some ...
2
votes
1answer
100 views

Fourier series of oscillation in form $\cos(2 \pi \frac{k}{T}+\phi)$

I would like to calculate the fourier coefficients of $\cos(2 \pi \frac{k}{T}+\phi)$ where $T \in \mathbb{N}$ is the period and is arbitrary but fixed, $k \in [1, N-1]$ is the number of oscillations ...
0
votes
1answer
36 views

Sorting and removing data in MATLAB

I am new to MATLAB and I have to analyze a file containing lighting data from WWLLN. The data file contains: latitude of stroke in first row, and longitude of stroke in second row This file has ...
2
votes
2answers
781 views

Matlab Code to simulate trajectories of Ito process.

I need some help to generate a Matlab code in order to do the following question. Can somebody help me in this regard. Any sort of hint that could be helpful will surely be appreciated.. Q: "Simulate ...
2
votes
1answer
223 views

Differentiation of a parametric function using MATLAB or Maple

I'm doing some mathematical calculation of some symbolic math that includes multiplication and differentiation of some matrices. Some of the parameters in my calculations are functions of time. for ...
6
votes
2answers
378 views

Image Reconstruction:Phase vs. Magnitude

Figure 1.(c) shows the Test image reconstructed from MAGNITUDE spectrum only. We can say that the intensity values of LOW frequency pixels are comparatively more than HIGH frequency pixels. $$ ...
1
vote
0answers
313 views

pdf of an uniform distribution in matlab?

I'm reading a book and I came across a problem in which I should generate a uniform random variable and use hist, mean and std ...
2
votes
0answers
94 views

How to solve this complicated differential equation?

I need to know how to solve this complicated differential equation in $z$ either analytically or numerically : \begin{eqnarray} \frac{dx_1}{dz} &=& -ib_1x_1 - ikx_2 \\ \frac{dx_2}{dz} ...
0
votes
1answer
55 views

How to solve these two differential equation?

I try to solve these two difference equation ; $$ \frac{dq}{dz} = -j\left(b_1q - kp\right),\\ \frac{dp}{dz} = -j\left(b_2p - kq\right) $$ where $j$ stands for $\sqrt{-1}$, and $b_1$ ,$b_2$ and k are ...
3
votes
7answers
464 views

Best Math Plotting Software for Electrical Engineering

I am an electrical engineering undergrad. I would like to learn a math plotting software which would be helpful in visualizing topics in advanced calculus (my immediate need). It would also be helpful ...
1
vote
0answers
133 views

what does autocorrelation matrix signifies in image processing?

I am trying to find out corners using auto correlation matrix in an image,what does it signifies?
3
votes
0answers
40 views

what is the significance of Eigen values of autocorrelation matrix?

I am trying to find auto correlation matrix of an image to get Harris corners.Paper I am referring suggest that if eigen values of auto correlation matrix are large the point will be corner point.so ...
0
votes
1answer
377 views

How to add standard deviation regarding MATLAB function normrnd(mu,sigma)?

My question depend on this scenario which is as follows, I used a MATLAB function "normrnd(mu,sigma)" with mean 'mu = 0' and S.D 'sigma = 5', to generate a normal random number "R1". I added this ...
1
vote
0answers
38 views

Matlab Optimization problem with Matrices

I'm trying to solve an optimization problem in Matlab. The expressions you will find below. Problem is it is all matrices, and I have no idea which solver to use for that. $w$ is of size $n \times 1$, ...
3
votes
1answer
167 views

Using Monte Carlo method to estimate the value of $\int_0^1\int_0^1e^{xy} \ dx \ dy$

Monte Carlo, estimate the value of $$\int_0^1\int_0^1e^{xy} \ dx \ dy.$$ I am using matlab to solve this problem. My code is the following: ...
3
votes
0answers
98 views

How can I find a tranformation matrix/Mathematical relation between two 5th degree polynomial curves in space?

I have the equation of two 5th degree polynomials which they don`t intersect with each other .Each curve is made of 100 points and these two curves looks similar but there are small differences .I am ...
0
votes
2answers
61 views

plotting two graphs in matlab

it's been 5 hours and I'm trying to plot two graphs in matlab but in vain, here is my code ...
0
votes
2answers
29 views

calculate principal components

suppose that we have following data ...
0
votes
0answers
178 views

Finding minimum of a distance function using matlab

I have a function for that I want to find the minimum. The function calculates the distance between two sets where a set is defined as matix of row vectors $ D = [ d_1, d_2, ..., d_n]$, $d_n$ is a $m ...
0
votes
1answer
2k views

Newton-Raphson Method for Non-linear System of 3 variables in Matlab

I am trying to solve 3 non-linear system of 3 variables using the newton-raphson method in matlab. Here are the 3 non-linear equations: \begin{equation} c[\alpha I+ k_f+k_d+k_ns+k_p(1-q)]-I \alpha =0 ...