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

Numerical integration in Matlab (Gaussian 3 point quadrature)

Write a Matlab function that applies the Gauss three point rule to N sub-intervals of $[a, b].$ The input parameters should be the name of the function being integrated, $a, b,$ and $N$. Attempt: ...
2
votes
4answers
89 views

Monte Carlo double integral over a non-rectangular region (Matlab)

I want to evaluated the following integral using Monte Carlo method: $$\int_{0}^{1}\int_{0}^{y}x^2y\ dxdy $$ What I tried using Matlab: ...
0
votes
1answer
11 views

MuPAD: plot sum of list elements

I am receiving an unclear error when trying to plot partial sums of elements of a list in MuPAD. Any suggestions would be appreciated. ...
0
votes
1answer
39 views

Solve $Ax=b$ for $A$ in MATLAB

I have this linear system $$\begin{bmatrix} cY(t-1)\\ acY(t-1) - acY(t-2)\end{bmatrix} = T \begin{bmatrix} Y(t-2)\\ Y(t-1)\end{bmatrix}$$ where both $c$ and $a$ are known constants, and I need to ...
0
votes
0answers
22 views

Simplifying MATLAB fraction to make numerator equal to 1

I have a function which returns this fraction, which is not in the needed format. $$\frac{36893488147419103232*z^2}{36893488147419103232*z^2 - 672282507639892864*z + 6656262451880127}$$ I need it to ...
0
votes
0answers
5 views

Mupad Scatterplot operand is invalid

Could someone please explain the following error? I am trying to plot (0,0) and (1,1) on a scatterplot in mupad. ...
-3
votes
0answers
19 views

discretization of a continuous filter [on hold]

I have a 1st order continuous filter T * y'(t) + y(t) = u(t) . I discretized the equation by hand and applied filter and I used ...
0
votes
0answers
26 views

Matlab ODE solving

So I have an ODE that needs to be solved a few thousand times on MATLAB and am wondering what the most efficient method to use would be. I am changing a constant term each time. My ODE is of the form ...
0
votes
0answers
8 views

The difference between awgn(x,snr) and awgn(x,snr,'measured')?

I use awgn function to add noise to my signal modulation to calculate BER. But when using awgn(x,snr), it make the result wrong, but true with awgn(x,snr,'measured'). I read on mathwork, they said ...
0
votes
1answer
8 views

Why equals the z-Transform $c^n * u(-n-1)$? according to Matlab/WolframAlpha?

$x[n] = c^n * u[-n-1]$ Where u[n] is Heaviside step function. According to Matlab and WolframAlpha this equals 0. However if I compute the sum according to the z-Transform definition I got (sum from ...
1
vote
0answers
9 views

Find the 1 dimensional empirical conditional distribution with data

I need to find the the conditional distribution function empirically of some data $C$, given the value of a particular predictor $y$. I have attempted to use Bayes as follows: $$ P(C \ |\ ...
1
vote
2answers
38 views

How to check if two sets of vectors span the same space in matlab/python?

In MATLAB/Python, is there a way to compare the subspaces span by two different sets of vectors and check if they are the same?
-2
votes
0answers
8 views

Significant digits and dloat point calculations [closed]

I have a function that resembles a probability tree. I built 3 solutions. 2 are recursive algorithms that calculate each unique outcome the alternative is a probability tree table. The 2 recursive ...
0
votes
0answers
16 views

Implementation of blind deconvolution for signal r(n) = h(n) * s(n) + a(n) in Matlab [closed]

r(n) is the recorded speech h(n) is impulse response of room acoustics s(n) is desired speech signal a(n) is noise from microphone I understand in order to find the desired speech signal, s(n), ...
0
votes
1answer
11 views

Need some help with matlab syntax for logical equivalence/inference

I've got a maths question that I need to translate into matlab syntax to run through and I'm slightly stuck so hopefully someone here can help since I can't seem to find my answer online. The ...
0
votes
0answers
37 views

How to distinguish as Linear or Non-linear constraints

In optimization problem $$\arg\max_{\substack{l_1 \in [0, 1],\cdots,l_{M} \in [0,1]}} T$$ I have $m=1\cdots,M$ constraints such that $$\ln \left[a_m\right] + \ln \left[ \left(\frac{l_m}{l_m + ...
1
vote
1answer
18 views

Covariance matrix - wrong results either in Matlab or in formula?

The definition of a covariance for discrete variables (taken from https://en.wikipedia.org/wiki/Covariance) is: $$\operatorname{cov} (X,Y)=\frac{1}{n}\sum_\limits{i=1}^n (x_i-E(X))(y_i-E(Y))$$ ...
-1
votes
0answers
7 views

Plotting experimental data in Matlab [closed]

I'm new to Matlab and i would like to plot experimental data. I have the values of the x axis and the y axis, but how do i save them in the workspace and how do i plot them? And how do i associate ...
0
votes
0answers
19 views

i want to pop a new window in matlab GUI [closed]

i want to pop a new window in Matlab GUI. I need to display three figures on new window. My existing GUI is full of figures and push buttons. ...
-1
votes
0answers
10 views

Defuzzification in MATLAB

Please help me.How to apply defuzzify in MATLAB? WHat is the X in defuzzy formula?? AS, x= -10:0:10 mf= (x,[-5 5 10]); out= (x,mf,'centroid') what is the x here.
0
votes
1answer
9 views

Find a Weight Function with specific characteristics

I need to build a weight function and I want to understand how you would do that. The reasoning you would use to define it. My function has to be something like: $f(\alpha)$ which is: $0$ if ...
-1
votes
1answer
17 views

Display the quotient between the value of an histograms

i'm triying to display the quotient of two histograms which have the same borders. Is it possible to do is with Matlab ? Thanks a lot !
0
votes
3answers
60 views

Matlab sum is wrong: Double symsum gives incorrect result

I'm trying to calculate the double sum $$ \frac{1}{10} \sum_{x=1}^{10} \left( \frac{1}{x} \sum_{n=0}^{floor(log_{10}x)} 10^n \right).$$ In MATLAB, my result is ...
0
votes
0answers
12 views

Match harmonics while decoding the speech signal

There is a matlab's program. In the input parameters is a wav file. After executing a program there are appearing an array of frames. Frames partially recover each other. In each frame there are ...
0
votes
0answers
10 views

is it possible to generate random ill-conditioned sparse matrix in MATLAB?

I know how to generate ill-conditioned dense matrices (use 'gallery'). I do not know how to generate ill-conditioned sparse matrices. Anyone help?
1
vote
1answer
22 views

using MATLAB to solve a linear program

Hello I am very new to MATLAB and having difficulty solving a linear program problem using MATLAB, I tried solving it however I am not sure If i did it correctly Use MATLAB to solve the following ...
0
votes
0answers
11 views

How to generate power spectra of AR-1 process in matlab?

I have a time series x1 as 3600x1 double. I need to fit AR-1 spectra on the power spectral density of x1. Well, I am not an expert and this is the first time I am studying time series. If AR-1 ...
1
vote
1answer
32 views

Can integrals be solved using MATLAB's ode solver? [closed]

I was wondering how I could solve a definite integral using a MATLAB ode solver? Thanks!
0
votes
0answers
15 views

Trying to implement an impulse response function in matlab giving wrong results

Hi all I am trying to implement equation of the Johnson Wilson model (used in blood flow analysis on medical images ) below: $$ R_{JW}(t) = u(t) - ...
0
votes
0answers
11 views

Order of Lobatto IIIa Method w.r.t MATLAB's bvp4c/bvp5c

I'm writing an overview about the use of MATLAB's bvp5c boundary value problem solver. In the literature (for example [1], pg 36), it is stated that the Lobatto IIIa methods are order 2s-2 for an s ...
0
votes
0answers
54 views

Linearising a system of ODE's

So I have this ODE: $$x''=\frac{-27}{13}x'+\frac{35}{13x}-\frac{4843}{283}$$ The question asks me to write a MATLAB script to linearise this ODE around any specified x value, as far as I know only ...
1
vote
0answers
20 views

Finding an invertible matrix $P$ such that $P^{-1}AP$ is a Jordan matrix

Find an invertible matrix $P$ such that $P^{-1}AP$ is a Jordan matrix. Is there a way in matlab to find such a matrix $P$ given $A$?
1
vote
1answer
23 views

Discrete Fourier transform implementation giving results that are order of magnitude off

I tried implementing a Discrete Fourier transform in Matlab, but I found my results an order of magnitude off. I used next definition of DFT: $$ F(u) = \frac{1}{2N} \sum^{N-1}_{x=-N} f(x) e^{- \pi i ...
1
vote
0answers
16 views

Interpreting the angle from the angle obtained by atan2 function

I have two signals ($x$ and $y$) whose absolute phases I'm calculating by using the atan2 function. Then subtracting both I'm getting the relative phase between two ...
0
votes
0answers
19 views

Rotate circle about line if a point on circle is on the line

I'm working with unit-distance graphs in $\mathbb{R}^3$, so all points are in $\mathbb{R}^3$ and points $x$ and $y$ are adjacent (notation: $x \sim y$) if and only if $|x-y|=1$ (where $|x-y|$ denotes ...
0
votes
0answers
13 views

Can I use Euler approximation for backwards computation?

I want to solve the following Ricatti Equation: in Matlab. I'm given the final value of P and as far as I understand I have to go backwards solving this. My question is, can I use the Euler ...
0
votes
0answers
24 views

Lagrange function on MATLAB

I'm trying to write the Lagrange function in Matlab and I need some help. This is what a friend and I have got so far, I am just not getting how to finish: ...
0
votes
0answers
20 views

randomly generate M pairs of complex numbers from 1 to N, find gcd.

I want to write a script to generate statistics on gcd's and number of steps required to find them by the Euclidean algorithm, using M randomly generated pairs $a+bi$ between 1 and N. And plot them. ...
0
votes
1answer
32 views

Solving equation in Matlab [closed]

I want to solve this equation for several values of y y=4 exp(0,034x) y= [60 14 63 34 21 12 11]; Thanks
1
vote
0answers
7 views

2D Fourier Differentiation in Matlab

I am working in Matlab to compute partial derivatives and a Laplacian using Fourier Transforms. I prefer to take spectral derivatives, since it corresponds to multiplication by a wave number, however, ...
0
votes
0answers
14 views

Find 2 point getting far away each other from their intersection point

I want to know how to find 2 aircraft getting far away from their intersection point, from Dataset such as aircraft 6-7,11-2, 10-6,37-36,etc. Dataset: my algorithm is: calculate direction ...
1
vote
1answer
18 views

How can I analyse signal with discrete wavelet transform?

With CWT it's clear enough. We have function of two variables which are scale and translation. But what about DWT? Here is Matlab code: ...
0
votes
0answers
15 views

Predict monthly event with pattern that repeats every year

General question: We look at "cost for maintenance" every month and it turns out that this is seasonal, e.g. in the summer this cost is significantly lower which can of course be explained due to the ...
-1
votes
1answer
19 views

Max value of a function in MATLAB

I am looking to find the max value of this function: log(x^(sqrt(2))) - x^3 + 4 I am having trouble with how to go about this problem. Any help is great. What I have right now is: y =@(x) ...
0
votes
1answer
28 views

MATLAB solve a single equation

I am trying to solve this equation: $e^x=x^e+e$ in MATLAB, but I continually get an error. I do not know where to go from here. Any help is appreciated This is what I have: a = x^exp(1) + exp(1) == ...
0
votes
0answers
5 views

Simulating AR(2) models with specific distributions

Say I want to create and simulate the $AR(2)$ model $X_t =1.5X_{t-1} - 0.5X_{t-2} + Z_t$, $Z_t∼WN(0,200)$ in matlab. To the best of my knowledge I define $model = arima('ARLags',1:2,'Constant',0)$ ...
2
votes
2answers
85 views

In MATLAB, $\pi$ value is given as 355/113. why?

$\pi$ is an irrational number. MATLAB shows it equal to 355/113 in fractional format. Is there no better fractional representation than 355/113 within the limits of the finite precision the ...
0
votes
1answer
23 views

implementing double $\sum_{m=1}^{p}\sum_{n=1}^{\infty }$ sum in MATLAB

I want to calculated following double sum: $$\sum_{m=1}^{p}\sum_{n=1}^{\infty }(-1)^{n-1}\Delta H.{erfc\frac{2(n-1)u+u\gamma}{2\gamma \sqrt{p-m}}+erfc\frac{2nu-u\gamma}{2\gamma \sqrt{p-m}} }$$ I have ...
0
votes
2answers
20 views

Comparision of Axis-angle and Euler-Angles contradicting?

I used SpinCalcVis to compare axis-angle against the euler-angles and think the angle signs of both are contradicting. I used q = -1 0 0 0 as input. Using the ...
1
vote
0answers
13 views

How to build a matrix in MATLAB with the next characteristics?

Let $\lambda_1=\frac{k D_u}{2h^2}$ a constant value. How to generate a matrix in MATLAB with the next entries: $A= \begin{pmatrix} 1+\lambda_1 & -\lambda_1 & 0 & 0 & \cdots & 0 ...