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
vote
1answer
36 views

Generate two matrices such that multiplication of these matrices results a symmetric positive definite matrix

I want to generate a tall&skinny matrix and a fat&short matrix, such that multiplication of these matrices results a symmetric positive definite matrix. My inefficient/expensive solution is: ...
0
votes
0answers
39 views

Delaying signals in Matlab

I'm new to MATLAB and have a question that I need help on: The problem I have is to plot the simple signals: a 1Hz Sine wave, a standard rectangle function and a standard triangle function Here is ...
0
votes
1answer
27 views

MATLAB: how to include running time on a graph? [closed]

I have a MATLAB/Octave program for which I used the tic and toc functions to measure the time elapsed for some calculations. e.g....
0
votes
0answers
15 views

Matlab for the joint distribution

I calculate one joint distribution function, and hope to implement it in Matlab. The function is a little complex: $$F_X(x)=P\left(\frac{z}{1+y}\leq x\right)= \int _{0}^{\infty}F_{Z/Y}(x(1+y))P_Y(y)...
0
votes
0answers
10 views

Optimize linear function with integral as a constrain

How can I solve a linear optimization problem with an integral as a constrain? I am looking for a Matlab toolbox. My optimization problem is: $\max_{\alpha} \sum_{k=1}^K \alpha_k \cdot x $ such that ...
0
votes
1answer
95 views

What is the value of $e^{-10000}$?

What is the value of $e^{-10000}$? We know that the function $e$ does not attain value $0$ anymore. But in R and Matlab the value of $e^{-10000}$ is given as $0$ which is not correct anymore. I ...
0
votes
0answers
17 views

How to Plot Silhouette with Sørensen–Dice Similarity Coefficient

How to plot silhouette with Sørensen–Dice similarity coefficient? I already have the cluster result and distance value. clust: 1 1 2 2 2 metric: ...
0
votes
1answer
50 views

Algorithm for getting consecutive line segment edge points from midpoints

So I have a rectilinear grid that can be described with 2 vectors. 1 for the x-coordinates of the cell centres and one for the y-coordinates. These are just points with spacing like x spacing is 50 ...
0
votes
1answer
19 views

How would you take advantage of the knowing the zeros in T, a tridiagonal matrix, in a code for Gaussian elimination?

When $T$ is tridiagonal, its $L$ and $U$ factor have only two nonzero diagonals. How would you take advantage of the knowing the zeros in $T$, in a code for Gaussian elimination? Find $L$ and $U$. $$...
0
votes
0answers
14 views

Did I implement a log-normal distribution incorrectly?

I have a bunch of data relating to the lengths of certain objects. I found out that the log of these lengths are somewhat normally distributed, so I used a lognormal distribution to approximate the ...
1
vote
3answers
35 views

Creating nearest neighbors Laplacian matrix

I want to create a general formula for an $N \times N$ nearest neighbors Laplacian matrix such that I can write an mfile in MATLAB to compute the matrix for given $N$. The nearest neighbors Laplacian ...
2
votes
1answer
200 views

Least-squares problem with quadratic equality constraint

I want to find the solution of a Lagrange equation whose inputs are matrices. First I have the equation Ax=0. By decomposing $A$ into $A_3$ (columns 9 to 11 of A), $A_9$ (the rest of the columns), ...
1
vote
1answer
25 views

type of the noise: PDF+Hypothesis test

I have a 2D matrix of values. I've considered these values as a noise. What I'm trying to do is to draw the PDF of my matrix and see the distribution of my data. But it is not enough to say that ...
0
votes
0answers
11 views

Maximum Likelihood estimator Matlab

Hello im having trouble to find the maximum likelihood estimator r using the Newton-Raphson method in MATLAB (while$\left| {{r}_{n+1}}-{{r}_{n}} \right|<{{10}^{-6}}$) where$G(r)=\ln (r)-\frac{\...
2
votes
0answers
65 views

How to decompose a 2d shape into sin and cosin modes?

Assume that you have a circle with radius $r_0$, then you keep adding cosine modes as below: $r=r_0+a_1\cos(1\theta)+a_2\cos(2\theta)+a_3\cos(3\theta)+a_4\cos(4\theta)+~...$ if you plot this as ...
0
votes
0answers
7 views

How to plot a sine function with changing pulse width? (PW values are obtained from an array.)

I am trying to plot a sine signal with it a varying PW. I defined PW as the duration of the pulse of I am generating. (The entire signal consists of 5 pulses separated by delays (i.e. arrays ...
2
votes
1answer
18 views

Matlab - set like datatype?

I'm need to work with Matlab again but it's long ago that I did so the last time. So I need your help (searching for "set" leads only to how to set colors of axis and so...). How can I achieve a set ...
0
votes
0answers
16 views

Calculation of an FIR filter in Matlab.

I have been researching FIR filter design with regard to my signal processing assignment and am having a lot of difficulty trying to understand how the frequency response and ultimately the magnitude ...
0
votes
0answers
22 views

2d Heat Diffusion Matlab

I am working on a 2d heat diffusion problem. I have to find the bottom boundary node equations. I am familiar with a mixed approach scheme to the 2d diffusion problem however the code provided does ...
0
votes
0answers
15 views

Determining the effect of a constant magnitude on a Runge Kutta solution

I have a 1st order PDE that ultimately requires a runge kutta solution. the formula is: $$\frac{Dr}{Dt}= k_0\left(\frac{1}{r^4}\right)\cdot t$$ Ultimately the runge kutta solution is an intermediary. ...
1
vote
1answer
64 views

Solving Fourth-Order ODE BVP using dsolve()

I'm attempting to solve the following ODE using Matlab's built-in function dsolve $$\frac{d^4w}{dx^4}=w$$ with the following boundary conditions: \begin{align} \frac{dw}{dx}(0)&=0\\ \frac{d^3w}{...
0
votes
0answers
39 views

Triangulation with two camera setup - Result in world or camera coordinate system?

I have some problems to understand how I can triangulate a 3D-point using a two camera setup. Let's assume I'm using a right handed coordinate system and the camera is looking in positive z-...
0
votes
0answers
34 views

recursive least squares for nearly singular matrices

I have an image reconstruction problem which I want to solve as a linear system $Ax=y$. A matrix is big, but for the beginning I can shrink the imaging region to $nPix$ = 2000 pixels. number of ...
0
votes
0answers
7 views

Mixed convection - Matlab

So I am trying to solve the following mixed convection problem in Matlab: for $x=0: u=v=0, T=Th$ (heated wall); for $x=L: u=v=0, \frac{\partial T}{\partial x}=0$; for $y=0: u=v=0, \frac{partial T}{\...
1
vote
0answers
5 views

Hurst exponent Algorithm not well defined? What to do in this case?

The R/S algorithm is well known for finding the Hurst component of a given data set. I have one query about whether it is well defined? Suppose in a given partition, all of the values were equal to ...
0
votes
1answer
76 views

Ball motion with air resistance coupled differential equation for fourth-order Runge-Kutta

I've created a MATLAB function for solving coupled differential equation with the fourth-order Runge-Kutta method based on what is provided here (Simultaneous Equations of First Order). Here the ...
0
votes
1answer
19 views

How to expand the matrix in Matlab (forming $A$ matrix in least square problem)

If I have 5 data points (actually, this could be vary huge number): $a = [1;2;3;4;5]$ To each data point, I can form a matrix $[a(i),2a(i)]$. (actually, I have to find the matrix, this matrix needs ...
2
votes
2answers
34 views

How do I build this band matrix in MATLAB?

I need to build a pentadiagonal matrix in MATLAB like this: $\begin{pmatrix} 1+2\lambda & -\lambda_1 & 0 & -\lambda_1 & 0 & \cdots & 0\\ -\lambda_1 & 1+4\lambda_1 & -\...
0
votes
1answer
52 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
122 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
30 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
43 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
7 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. ...
0
votes
0answers
27 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
11 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 ...
1
vote
1answer
18 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
12 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 \ |\ y)=\frac{P(...
1
vote
2answers
46 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?
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
43 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
21 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))$$ ...
0
votes
1answer
11 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 !
1
vote
3answers
74 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
13 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
15 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
23 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
15 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
34 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!