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
1k views

Low rank approximation using CVX toolbox in Matlab

I try to use CVX toolbox to do "low rank approximation" work. The code is as follows: ...
0
votes
1answer
918 views

Simulink model from a nonlinear State Space

I have the nonlinear state space already constructed in MuPAD as shown: u is the input and y is the output. What is the best way for me to take this to Simulink?
1
vote
1answer
191 views

How to draw or plot illustrative figures?

stackexchange users I would like to plot or draw some illustrative figures for my research paper. I've tried GeoGebra already. But couldn't draw them as I wanted. So my question is How can I draw ...
2
votes
0answers
2k views

How to find the Total Harmonic Distortion of a Periodic Signal through MATLAB?

How to find the Total Harmonic Distortion of a Periodic Signal through MATLAB? I just need help in confirming if my way of approach to finding the THD seems valid, I'm new to MATLAB so I'm not quite ...
1
vote
1answer
178 views

MATLAB, 1st order 2d hyperbolic equation, problem with convergence.

Follow up to my previous question: MATLAB: solving 1st order hyperbolic equation in 2 spacial dimensions The equation I'm solving has the form: $$f_t + A y f_x - B x f_y =0$$ I wrote the following ...
2
votes
1answer
44 views

Weed out numerical artifacts from matrix inversion

I am working with the inverses to a set of large sparse matrices (in Matlab). A key indicator for my application is the number of non-zero entries in each row, and I recently discovered that I was ...
3
votes
1answer
265 views

MuPAD - complicated solve() solutions

I am trying to solve an equation for one variable as shown in the picture: Judging from the output of the second command, I should be able to get an expression for $\ddot{\theta}$. I tried ...
0
votes
3answers
50 views

How do I define this matrix in matlab?

$$A = \begin{pmatrix} 2 &-1 & 0 & \dots & 0 \\ -1 & 2 & -1 & \ddots & \vdots \\ 0 & \ddots & \ddots & \ddots & 0 \\ \vdots & \ddots & -1 & 2 ...
2
votes
1answer
370 views

MuPAD - rearrange an equation

I have a huge expression, say $f(x_1,x_2,x_3) = 0,$ and I want MuPAD to try to express $x_1 $ in terms of $x_2$ and $x_3$ Is this possible?
1
vote
1answer
102 views

MuPAD equation solving

I have x(t) defined as: x(t) = Symbol::subScript(x,0) + Rb*`φ`(t) I want to write the derivative of ...
-1
votes
1answer
108 views

How can I integrate over an infinite interval in Matlab? [closed]

Would you please help me integrating the following function over an infinite interval in Matlab. Many thanks $$ \int_{-\infty}^{\infty}P(\lambda)P(0.1-\lambda) e^{-j2\pi \lambda} $$ In which ...
2
votes
1answer
60 views

Is there a function in MATLAB that will estimate the initial condition from a set of data?

I was given a state-space model of a system and a list of outputs for t=0 to t=5, sampled every 0.1 seconds and asked to approximate the initial condition. Is there a function in MATLAB that will take ...
1
vote
1answer
372 views

MATLAB: solving 1st order hyperbolic equation in 2 spacial dimensions

According to wikipedia, the equation $$\psi_t + \mathbf{u} \cdot \nabla \psi =0$$ is hyperbolic. However, when I want to solve it in MATLAB using the pde toolbox (link), the general formula for a ...
2
votes
0answers
76 views

Simulation Velocity of a harmonic oscillator system

I am write a simulation for get true Velocity of a harmonic oscillator system as Where P=[p1 p2;p2 p3] can find using Rung-Kutta Integration method with P(0)=[1 0; 0 1] This is code to find p Now, ...
1
vote
0answers
39 views

Optimizing rank computation for very large sparse matrices

I have a sparse matrix such as ...
1
vote
1answer
2k views

How do I plot normal distribution

If I know the range (1-24) and know the area (X), how can I plot a normal distribution so that the curve has area X?
1
vote
1answer
24 views

plotting an fft function

need to plot the folowing: $$X(j\omega)=\cal F\{{2\over\pi\lambda}\}*\cal F\{sinc(2w_m\lambda)\}-\cal F\{{4\over\pi\lambda}\}*\cal F\{sinc(w_m\lambda)\}$$ as a plot of $|X(j\omega)|$ for ...
1
vote
2answers
59 views

Would taking a course in Linear Algebra help with working with Matlab?

I'll soon be using Matlab in an engineering course I'll be taking next semester. So given how Matlab stands for Matrix Laboratory and Linear Algebra has a lot of matrices involved, does such a Linear ...
0
votes
1answer
282 views

fourier transform in matlab

getting an error while trying to do fourier transform. my code: ...
0
votes
1answer
309 views

Plotting multiple curves using ODE45

I am a beginner to using MATLAB, and I need a lot of help to understand what to do here. I would like to plot multiple curves using different initial conditions to my system of ODEs. Here is my ...
1
vote
1answer
112 views

Compound Gaussian distribution using matlab

I want to ask how can we generate Compound Gaussian distribution using matlab?
2
votes
1answer
54 views

How much RAM is needed for $2^{14}$ square grid of double numbers?

How is calculated the memory that is needed for matrix of $2^{14}$ by $2^{24}$ double precision real numbers ? Matlab stops responding with 32Gb ram.
1
vote
1answer
591 views

How to set a residual bound for fsolve() in Matlab?

Peace be upon you, I have the following system of equations \begin{align*} \begin{cases} \psi(x_1)-\psi(x_1+x_2)+0.6931471805599456\\ \psi(x_2)-\psi(x_1+x_2)+0.6931471805599456 \end{cases} ...
1
vote
1answer
370 views

How to solve a nonlinear system in Matlab without saving a function

Peace be upon you, I have a system of equations to be solved. I know that I can solve my system in Matlab like this: ...
1
vote
0answers
202 views

About Intersection of two convex polytope?

the intersection of two convex hull of two polytope P and Q , is it the convex hull of the intersection of P&Q ? Conv(P) ∩ Conv(Q) = conv(P∩Q) ???.
1
vote
2answers
1k views

Matlab: Impulse response of linear time invariable (LTI) sine-signal

I'm preparing for a lab in a Signals and Systems course in my university, 5th semester. I've found old exercise material from the class and since I know some Matlab and have dealt with LTI systems ...
1
vote
0answers
149 views

Solution of equations involving determinant and matrix inverse

$x$ and $y$ are two scalar unknowns. The two equations are $$|\mathbf{I}+x\mathbf{h}_1\mathbf{h}'_1+y\mathbf{h}_2\mathbf{h}'_2|=R$$ and ...
2
votes
0answers
36 views

Quality of sinusoids in matlab plots

I am new to using MATLAB and used a plot to generate the graph for a simple sinusoid. The plot is that of a $50$Hz signal, $y=20\sin(100\pi t)$; it was plotted from $-1$ to $1$ sec the plot which I ...
1
vote
1answer
117 views

Random number generation in MATLAB with condition

How can I generate random numbers in MATLAB with the condition that each new number has a minimum difference with all previously generated numbers for that matrix. So, X = rand(1,20) would generate 20 ...
0
votes
1answer
47 views

Recurrence relation for the coefficients of the polynomial $p_n(x) = \prod_{i=0}^{n-1}(x-i)$

Let's consider the polynomials $$ p_n(x) = \prod_{i=0}^{n-1}(x-i)=\sum_{i=1}^{n} a_{n,i}x^i$$. for all $n \in \mathbb{N}$. If $n=1$, then $p_1(x) = x$ and $a_{1,1} = 1$. Since I know that: ...
0
votes
1answer
46 views

re-writing a mathematical expression

I am reading the following paper: http://www.nova.edu/ocean/Physics/PDF/Solovievetal2007.pdf and am trying to write a MATLAB program to solve equation 1.26, which is shown as: $$ K_{int} = ...
1
vote
1answer
128 views

As I can put the Neumann boundary conditions? the Crank Nicholson scheme, the Heat Equation

How i can put the Neumann BC in my code? I tested but I get error, because the arrays are not the same size $$U_t=U_{xx},\quad 0<x<1$$ $$u_x(0,t)=0$$ $$u_x(1,t)=0$$ $$u(x,0)=f(x)$$ I have my ...
1
vote
1answer
271 views

A signal with multiple frequencies…

I'm doing an assignment on Fourier series in MATLAB. The first part states: Generate a signal with frequencies $50$Hz, $150$Hz and $300$Hz. I can easily generate a signal with one frequency, ...
2
votes
1answer
737 views

Fast fourier transform and nyquist frequency

Trying to figure out how to use Matlab to calculate the nyquist frequency of a signal. Given a function, lets say $y = 5\sin (2t + \pi /3) + \sin (t + \pi /2)$ for $t > 0$. How do we use a fft in ...
1
vote
2answers
104 views

Weird MATLAB differential equation solution

I want to solve this differential equation $$ \dot x =-\lvert x\rvert , x(0)=-1 $$ MATLAB dsolve says the solution is $x=-e^{-t}$ but my intuition says that since initially $\dot x=-1$ the solution is ...
1
vote
1answer
2k views

Phase shift of two sine curves

How do I determine phase shift of two sine curves (discrete time sampled sine curves) in Matlab. Currently, I have the FFT of these two sine curves, the phase shift is just the delay in time, which ...
1
vote
1answer
57 views

How to turn off scientifc notation when using char command in Matlab?

I want to convert a polynomial expression into an array of characters in MATLAB. We are using the command char. On my computer, char will change the format of the coefficients of a polynomial to ...
1
vote
1answer
708 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
1answer
158 views

How to use matlab to a simple convolution problem (a convolution of the solution of the diffusion equation with continuous sources)?

I assume this is a simple problem, but since I don't have a strong maths background, I have trouble to implement this in matlab. Could anyone help me with it? Many thanks! The concentration of a ...
1
vote
0answers
158 views

solving system of differential equation used in HIV modeling by matlab

I am really fearing with my project thesis and I need a desperate help..I am working on a HIV modeling and there are several's of non linear differential equations. I need them to be solved but I ...
0
votes
1answer
56 views

Numerically solve integral with a function as variable of integration

I want to use a function as variable of integration for example in evaluating the integral: $\int_0^1 e^{\cos x}f(\sin x)d\cos x$ in which $f(x)$ is an arbitrary function.
0
votes
1answer
89 views

Finding the max distance between two arrays

I have the solution of an ode as an array $x(t_k)$ where $k=1,...K$. I have another array which is an approximation to the solution of the ...
3
votes
1answer
817 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
1answer
34 views

Matlab: Accessing parts of anonymous functions

If I define an 2 by 1 vector anonymous function in MATLAB: F=@(x,p)[a*x(1)*(1-x(1))-x(1)*x(2)-p*(1-exp(-q*x(1)));... -x(2)+b*x(1)*x(2)*exp(-x(2)/c)]; is there a ...
0
votes
1answer
439 views

Matlab integral with parameter

I'm a beginner with Matlab, and I'm trying to solve the following problem. I'd like to define a function $$F(x) = \int_0^{+\infty} \frac{\sin t}{1 + xt^4} \, dt$$ and plot it on the interval ...
1
vote
1answer
114 views

State space system gives different bode plot then transfer function matrix

I have a discrete state space system with matrices $A$,$B$,$C$ and $D$ with sampling period $T_s$. I can either create a state space system, sys1 = ss(A,B,C,D,Ts), ...
0
votes
1answer
31 views

How do I solve $0 = x\times114 - x\times\log_3(x) - 20.28\times y$ in matlab for different values of $y$?

I have $y = 10^3, 10^6, 10^9, 10^{12}, 10^{15}, ...$ and above mentioned equation. How do I solve (i.e. getting values of x for different y) and plot this equation in MATLAB ?
0
votes
1answer
157 views

How to isolate colour Green from the Picture.

The picture is: How do I isolate the green chips? The result must be in black and white. It doesn't have to be perfect. To isolate the blue ones I used: I=imread('Picture.png'); ...
1
vote
1answer
23 views

Matlab Gamma trasform question. One pixel transform.

How do I do this question? For a) I believe the value of $c=\frac{1}{255}$ but I'm not sure. Can anyone help?
1
vote
0answers
72 views

solve complicated system of non-linear equations numerically

I have two algebraic equations I am trying to solve in MAPLE. They are: $14\,{a}^{26}{b}^{2}-91\,{a}^{24}{b}^{4}-364\,{a}^{22}{b}^{6}-1001\,{a} ...