Tagged Questions

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
5 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
0answers
6 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
19 views

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

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
33 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
9 views

Trouble with horner function in MATLAB [on hold]

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, ...
-1
votes
3answers
25 views

How do I define this matrix in matlab?

How do I write this matrix in matlab?
1
vote
1answer
18 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
21 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
11 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
24 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
50 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
42 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
25 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
15 views
-1
votes
0answers
31 views

Implementing Simpson's rule in Matlab [closed]

I need to make a function in Matlab : simpson(f,a,b) Where $f , a , b$ get plugged in to the following Integral: $$\int_a^b f(x)\,dx=\frac{h}{3} ...
-2
votes
0answers
15 views

Matlab Simpson's 1/3 rule [closed]

I'm a bit new to stackexchange, so forgive me if i made mistakes in posting this. I'm trying to write a function for the simpson's 1/3 rule, in matlab which approximates definite integrals. i would ...
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?
0
votes
0answers
52 views

Sigma-Algebra MATLAB code [closed]

By Definition of Sigma-Algebra, I want to use MATLAB to computing any Sigma-Algebra. Actually I want to know is there any program to compute the smallest sigma-algebra of 2 sets or more? I think ...
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
43 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 ...
-4
votes
0answers
33 views

Probability question. Mathlab help needed! [closed]

I'd like to use Matlab to solve this problem. So could anybody here please help me to translate this below problem into Matlab's language. There are 10 cards in a box that each has its number from 1 ...
0
votes
1answer
21 views

fourier transform in matlab

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

Compound Gaussian distribution using matlab

I want to ask how can we generate Compound Gaussian distribution using matlab?
2
votes
1answer
32 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
10 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
23 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
26 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
27 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
10 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
29 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
14 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
11 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
17 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
17 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: ...
0
votes
0answers
27 views

Optimization problem in image processing

I recently heard of the interior point method in nonlinear optimization problems and was also told of its (likely) usefulness in image processing. MATLAB of course, has just a function for that called ...
0
votes
0answers
12 views

Find the order selection in ARMA model (q & p )

I write a ARMA model in Matlab and before i calculate the predict value with the error i set the order selection (p,q) to some random value but how To determine the number of AR and MA lags
0
votes
1answer
39 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
40 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
16 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
38 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
56 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
43 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 ...
0
votes
1answer
26 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 ...