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
votes
1answer
27 views

Roots of an equation using Maple

I am using Maple to find the roots of a non-linear equation in one variable. When I solve the equation, I get only 2 negative roots whereas if I plot the graph of the function, it also shows that the ...
1
vote
0answers
22 views

Incorrect angle detected between two planes

I want to calculate the angle between 2 planes, Reference plane and Plane1. When I feed the X,Y,Z co-ordinates of pointCloud to the function plane_fit.m (by Kevin Mattheus Moerman), I get the output ...
0
votes
1answer
12 views

Beta-binomial random number generator

Could someone help me find a random number generator from a Beta-Binomial distribution in MATLAB, R or SAS? Thank you!
0
votes
1answer
18 views

Building an nth order ODE in Maple (or Matlab)

The question is simple: given a system of ODEs, how can one construct the equivalent nth order ODE in Maple? In my case I have $$ \begin{cases} y''(t)+x'(t)+x(t)=f(t)\\ y''(t)+z''(t)+z'(t)+z(t)=0\\ ...
0
votes
0answers
10 views

Inverse Power Iteration converges to largest eigenvalue instead of smallest?

I am trying to write a Matlab function that takes a matrix and an iteration count and performs inverse power iteration to output the smallest eigenvalue. The problem is, as k increases, the function ...
1
vote
1answer
22 views

create a Gaussian distribution with a customize covariance in Matlab

the Matlab function 'randn' randomize a Gaussian distribution with $\mu= \begin {pmatrix} 0\\0\end{pmatrix}$ and $cov= \begin {pmatrix} 1&0\\0&1\end{pmatrix}$ Ineed to randomize a Gaussian ...
1
vote
1answer
24 views
+50

Higher order numerical PDE schemes near boundaries, implementation in MATLAB

Followup to my previous question. The first order scheme proved unstable for my pde: $$f_t + A y f_x - B x f_y =0$$ So I'm looking to implement a higher order scheme (using these tables). I was ...
-2
votes
0answers
17 views

I need help about about 2nd order nonlinear differential equation in Matlab

I have to write a program in matlab to solve the $$\frac{d^2y}{dt^2}-(1-y^2)\frac{dy}{dt}+y=0,\hspace{0.5cm}y(0)=\frac{dy}{dt}(0)=\frac{1}{2}$$ I wrote the following code; ...
0
votes
1answer
20 views

Fitting a polynomial model to the data

I want to fit a line to the following data. But the line I have obtained is far from the data. What is wrong in the following least square problem? ...
1
vote
0answers
39 views

calculate the second derivative using `ode45`

I have a second order differential equation. I am using ode45 to solve the problem. ode45 converts the equations to the first ...
0
votes
0answers
21 views

what is the problem of this code. main problem is in function-handle. [closed]

The following error occurred converting from function_handle to double: Error using double Conversion to double from function_handle is not possible. and this is ...
0
votes
1answer
27 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
36 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
57 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 ...
0
votes
1answer
32 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 ...
0
votes
2answers
23 views

How to do iteration in Matlab (for/while loop question) [closed]

I am new to matlab and confused about the iteration. I've read definitions or some examples online but still encountered difficulties when solving problem. Here is a question that I hope someone can ...
2
votes
1answer
34 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 ...
2
votes
1answer
21 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 ...
1
vote
0answers
12 views

Trouble with horner function in MATLAB [closed]

I have the following homework question: Apply linear least squares with the two models S1(A, B, C) = Ax^2 + Bx + C and S2(A, B, C, D) = Ax^3 + Bx^2 + Cx + D to the data set (0, 4), (1, −1), (2, ...
0
votes
3answers
36 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 ...
1
vote
1answer
21 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?
0
votes
0answers
25 views

Using matlab to plot periodic orbits of a map

I am trying to plot periodic orbits of a map upto period 10 and I need help with the matlab code (not an expert in matlab). I talked about it to my advisor and this is what I have until now: In this ...
0
votes
0answers
8 views

plot a zero-order hold in matlab

I need to plot the following zoh expretion for$\ \ \ |\omega|\le20\pi,w_m=3\pi$ $$X_{ZOH}(j\omega)=\\ {2w_m\over j\pi ^2}e^{-5j\omega \pi/4w_m}sinc({\omega \over 2w_m})\sum^\infty_{k=-\infty}{2w_m ...
0
votes
0answers
14 views

MuPAD - differentiating a parametric function

I have a function of x(t) and theta(t). I want to differentiate wrt x(t), but I get an error when I try that. I will also need to differentiate the function wrt to x'(t). Any suggestions?
1
vote
1answer
27 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
0answers
10 views

How can i get the Transfer function of this Equation?

I have an equation with i want to simulate in Matlab. the Equation is y(t) = a/(b+x(t)) here x(t) is the input and y(t) is the output and a b are some constant. I don't know to to make its Transfer ...
0
votes
1answer
57 views

How can I integrate over an infinite interval in Matlab?

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
2answers
44 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
30 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
29 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, ...
0
votes
0answers
12 views

Simulation Position of a harmonic oscillator system

I am write a simulation for get true Postion of a harmonic oscillator system as Now, I want to write matlab code to get the true postion z of the system. However, ...
1
vote
0answers
17 views
1
vote
1answer
26 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
15 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
46 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
21 views

fourier transform in matlab

getting an error while trying to do fourier transform. my code: ...
0
votes
1answer
32 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
36 views

Compound Gaussian distribution using matlab

I want to ask how can we generate Compound Gaussian distribution using matlab?
2
votes
1answer
34 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.
0
votes
0answers
12 views

Unexpected Asymmetry in Tate-Bryan angles extracted from perturbed Quaternion

I’ve checked some references and the following MATLAB code seems to be correct for converting a quaternion to body roll, pitch, and yaw Tait-Bryan angles respectively. ...
1
vote
1answer
27 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
27 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: ...
0
votes
0answers
30 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) ???.
0
votes
1answer
14 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
32 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 ...
0
votes
0answers
17 views

Edge detecting - how to detect the most accurate edges using the Canny and Sobel methods?

For some reason, I believe this question belongs here and not to the StackOverflow. Anyways, Here's an exercise I have to solve: Repeate Lab Exercise 2 but with the matlab eight.tif image. The ...
0
votes
1answer
15 views

CTFT and DTFT in MATLAB

Is it possible to plot CTFT and DTFT in MATLAB? I know of DFTs(FFTs) in MATLAB since I am using them but what if I want CTFT and DTFT? If yes, then what function shoulf I use?
2
votes
0answers
18 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
18 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
28 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: ...