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
18 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 ...
0
votes
0answers
16 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
19 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_m)^\top \in \mathbb{N}^m $, where $ \mathbb{N} $ are the natural numbers without ...
1
vote
1answer
15 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
28 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 ...
-1
votes
0answers
9 views

Replacement for rng('default') in MATLAB [on hold]

Can someone please help me with a replacement for rng('default') in MATLAB? My version is 7.9.0 (R2009b). Thank you.
0
votes
0answers
22 views

Matlab code for higher order scheme

Can somebody help me how to generate the code for the increment $\Delta$Z in the document I have attached? I know how to generate the rest of the increments but struggling in how to generate ...
0
votes
0answers
31 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
23 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
21 views

Syntax of Upper Incomplete Gamma Function in MATLAB [on hold]

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

Strange matrix multiplication behavior in Matlab

I noticed strange behavior of some calculations in Matlab. Matlab code listing: ...
2
votes
1answer
27 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$; ...
-1
votes
2answers
55 views

Matlab code for Confidence interval [closed]

I need some kind of assistance in how to work on the following question. Thanks in anticipation. simulate $M=20$ batches of length $N=100$ of $U(0,1)$ distributed random numbers and evaluate the ...
0
votes
1answer
17 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 ...
0
votes
0answers
17 views

formulate optimization problem in MATLAB [closed]

I have set of weights: lets say my long only portfolio looks like this id weight bweight GROUP A 0.25 0.3 T B 0.1 0.25 T C 0.05 0.25 E D 0.6 0.2 E I have a 4x4 cov as well I would like to add ...
1
vote
1answer
37 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
17 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
23 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
28 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
13 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 ...
0
votes
0answers
17 views

Matlab: solve system of equations using substitution

Suppose I want to solve a system of equations $F(x)$ which is shown as below: $x_1^3+1=0$ $x_1+x_2=0$ I want to substitute $x$ by $x_1=2y_1, x_2=3y_2$. Then the original system is transformed to ...
2
votes
4answers
110 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
19 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
24 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
votes
0answers
20 views

Using matlab ode23s to solve the 6 nonlinear differential equations:

Using matlab ode23s solver i am trying to solve the 6 nonlinear differential equations: Non-linear differential equations: $ \frac{dc_0}{dt}= c_0*(- K_F - K_D - K_N * s_0 - K_P*(1-q_0))$ ...
2
votes
0answers
23 views

writing a simple matrix [closed]

question given A as a matrix of dimension m x n, write a simple script unit with the assumption that there exist a new matrix B(with dimension n x m). produce a new matrix called C as a prod of A ...
0
votes
0answers
27 views

Error in Matlab code, help please

I have a Unitary matrix MM1 and a theta function , I am trying to create another analytic function f by by summing up the products MM1(i, j)*thet(j) i.e say when j =1 f(1) = (MM1(1,d)*thet(0)) + ...
0
votes
0answers
33 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
0answers
13 views

Get a set of points from Fourier plot on Matlab?

I have a program that collects raw data and also does a Fourier transform to get complex numbers. When I feed the raw data into Matlab to do its own FFT, I can get a nice plot of power on frequency. ...
0
votes
0answers
18 views

Kullback-Leibler or Jensen-Shannon divergence between two distributions.

i would like to understand well what Kullback-Leibler or Jensen-Shannon divergence between two distributions will tels us about two distribution,for instance let us consider following code ...
0
votes
0answers
32 views

An error in least square optimization problem in Matlab

I am new to MATLAB and I want to formulate the following lease square expression in Matlab. I have some codes that I am typing here. But the optimization problem solution seems not to be correct. Does ...
0
votes
1answer
44 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
29 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
27 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
43 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 ...
0
votes
1answer
8 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
21 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
19 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
34 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
33 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 ...
0
votes
0answers
7 views

testing for goodness of fit [migrated]

I am using Matlab 2012a to run those 3 tests. When i run with my data, all the time I obtain very small values and for the AD tests, the results are not even normalized. please verify my code. I am ...
2
votes
1answer
42 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
24 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
106 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 ...
0
votes
0answers
20 views

inverse laplace for a system of matrices

any body can help me to get the inverse Laplace for the transfer function below using matlab X=F/(S(m*S^2+C*S+K)) knowing that F & C & K & X are all matrices I will be grateful for any ...
2
votes
1answer
27 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 ...
3
votes
1answer
36 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
1answer
36 views

How can we represent an image using basis images?

I have read that using Fourier transformation we can decompose any arbitrary image into orthogonal basis images and reconstruct it back. But i don't understand terms like "orthogonal " and "basis ...
1
vote
0answers
30 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
56 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} ...