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

0
votes
0answers
24 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
31 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
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
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
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 ...
1
vote
0answers
20 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 ...
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
29 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
2answers
1k views

How to plot a phase portrait for this system of differential equations?

I beg your help.. I'd like the phase portrait for this system. I don't know how to use Mathematica/Matlab ... :( If anyone can make this portrait and post a print screen here, I would thank you ...
0
votes
0answers
23 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 ...
-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
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
vote
1answer
568 views

Solving double integral numerically in matlab

In the paper "The fractional Laplacian operator on bounded domains as a special case of the nonlocal diffusion operator". Where the author has solved a fractional laplacian equation on bounded domain ...
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 ...
1
vote
1answer
896 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 R = [0.8978*c - 0.8047*b - 0.020299*a, 0.8978*d - ...
3
votes
7answers
172 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 ...
2
votes
1answer
1k 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 ...
1
vote
1answer
39 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 ...
-1
votes
1answer
21 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
29 views

Strange matrix multiplication behavior in Matlab

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

Visualizing elemental rotations using Euler angles in Matlab

I'd like to visualize elemental rotations using Z-Y-X convention in Matlab. If you'd like to follow me exactly, I'll be refering to a paper Quadrotor Dynamics and Control by Randal Beard. The base ...
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 ...
2
votes
1answer
28 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
1k views

Projection matrix onto null space

I have a matrix H and I want to find the projection matrix onto null space. How can I do this? Sorry if my question seems naive. Thank you, Tanja
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 ...
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) ...
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
2answers
172 views

Complementary error function in matlab

Please I really want to know how to verify the following relation in MatLAB $\text{erfc}(x)\overset{x\rightarrow\infty}{\longrightarrow}\dfrac{e^{-x^2}}{x\sqrt{\pi}}$
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 ...
2
votes
3answers
792 views

draw an Ellipsoid given its quaderatic equation in Matlab

How can I draw an ellipsoid in Matlab with following equation: $aX^2 + bY^2 + cZ^2 + d XY+e XZ +f YZ +gX +hY+iZ=R^2$ with (for example) $a=1; b=2; c=3; d=4; e=5; f=6; g=7; h=8; i=9; R^2=10.$
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
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
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
14 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
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
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
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 ...
1
vote
3answers
257 views

3D plot problem

I have a matrix $(A_{10*10})$ in which each elements of matrix states the value of the function $y=f(x,y)$. Since, $y$ shows the enclosed area between two squares, so I don't have the value of these ...
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 ...
1
vote
2answers
72 views

Non linear curve

If there are set of points (16.26,1000) (8.814,2000) (6.06,3000) (4.602,4000) in a similar way if you plot these points in matlab you will get a nonlinear curve. After getting that curve, how to find ...
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 ...
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
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: ...