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
27 views

Plot given points\lines\arcs in 3D

I need to plot 6 points in 3D by using Matlab. I used the command 'plot3' but I couldn't draw it. The coordinates of points $A,A,B,B',C,C',D$ are given. $AD,BD,CD$ are straight line segments ...
1
vote
2answers
61 views

How to solve this equation numerically???

The equation is given by $$ \sum_{n=1}^N \min(\gamma, \beta a_n)=N$$ where $\beta$ is the variable with $\beta\in[0,\sqrt\gamma/\min(a_n\mid a_n>0)]$, $ \gamma $ is a constant with ...
1
vote
1answer
22 views

Matlab, how do I change the default scatter plot size?

I am trying to do a approximation plot with Runge Kutta. In matlab, the discrete plot I use is "scatterplot". Unfortunately because of so many data points, the data points get mashed in and forms a ...
-1
votes
1answer
29 views

AX=B in Matlab solution [on hold]

I am new to MATLAB and wanted to solve a linear equation and come across a problem The matrix A is [ 3 6; 6 14] and B Is [ 5;11] According to ...
0
votes
0answers
6 views

creating smooth 2d plot with only a scaled colorvector and (x,y) coordinates | (matlab plotting issue)

I've an issue with visualizing the data in a correct way. I have an array with 3 colums and N rows. ...
0
votes
0answers
15 views

Plot symbolic function in MuPAD

I define a symbolic function in MuPAD as f:=A*cos(omega*t+phi) I'd like to plot (in 2D as function of t) that function for ...
1
vote
0answers
18 views

how to vectorize this kind of loop for array. [on hold]

I'm newbie to Matlab. I have some questions. How i vectorise this loop ...
0
votes
0answers
26 views

How to solve a bi-quadratic equation with symbolic coefficients?

I have the following equation with the symbolic coefficients specified using 'syms' which i have been trying to solve in MATLAB:- ...
2
votes
1answer
3k views

Solve a second order DEQ using Euler's method in MATLAB

I need to solve the equation below with Euler's method: $$y''+ \pi ye^{x/3}(2y' \sin(\pi x)+\pi y\cos (\pi x)) = \frac{y}{9}$$ for the initial conditions $y(0)=1$, $y'(0)=-1/3$ So I know I ...
3
votes
1answer
43 views

Runge Kutta stability

I am facing a problem solving a ODE with a Runge-Kutta 4th order method: The expression in order to solve is : \begin{equation} Ay^{''}+By^{'}+Cy= Cu \end{equation} \begin{equation} y =OUTPUT ...
1
vote
1answer
16 views

How to calculate a posterior probability with a given Gaussian Mixture Model?

I'm building a GMM-based classifier in speech processing and I'm using GMM as a probabilistic scoring mechanism (therefore I don't intrinsically care about the underlying mixture components). For ...
0
votes
1answer
445 views

One strange way to generate b-spline base

I am trying to use curve fitting under Matlab. There are two kinds of spline in Matlab: piecewise polynomials and b-spline. For b-spline, we know that the basic functions can be derived by means of a ...
1
vote
1answer
303 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 ...
1
vote
0answers
38 views

How to solve the matrix equation $A\overrightarrow{x}=\overrightarrow{b}$ in Matlab when nullitity$(A)\neq 0$

Say, $A= \begin{pmatrix} 1 & 0 &1 \\ 0 & 1 &1 \\ 0 &0 &0 \end{pmatrix}$ and $\overrightarrow{b}= \begin{pmatrix} 8 \\ -5 \\ 0 \end{pmatrix}$ and I want to solve ...
1
vote
1answer
24 views

Replacing pinv with inv in MATLAB

Let $\mathbf{y} = \mathbf{Ax}$ represent a system of equations where $A\in\mathbb{R}^{m\times m}, x\in\mathbb{R}^{m\times 1}$. However rank of $\mathbf{A}$ is $m-1$. I add another equation ...
0
votes
0answers
18 views

How to perform the following integration using dblquad in MATLAB

I am trying to perform the following integration in MATLAB \begin{equation} \begin{split} F &= @(x,y)(e^{(-0.5([x - \mu_1 \hspace{5pt}y-\mu_2])\Sigma^{-1}([x - \mu_1 ...
0
votes
1answer
320 views

Gaussian distribution and its parameters

I need to learn more about Gaussian distribution and given a set of data, plot a Gaussian distribution of it. Using the following code sample, could you please tell me how I can plot a Gaussian ...
1
vote
1answer
312 views

Roll PID Control for quadcopter

I'm trying to implement with simulink a PD controller for my quadcopter. I use a simplified model, and for the roll case I have $ I_x * \phi = L $, where L is the roll torque. So, the transfer ...
0
votes
1answer
344 views

Overlaying scatter points over world map in MATLAB

I am facing difficulty overlaying lightning location data over a region of the world map. I have lightning location data where the first column contains longitude and the second column latitude. I ...
0
votes
0answers
21 views

How to evaluate integral within an integral with symbolic limit in Matlab

I want to evaluate following integral which contains another integral inside. spol, which is a function of theta,is the lower limit of internal integral. The internal integral then will be multiplied ...
0
votes
0answers
7 views

Need help with getting 95% ellipse area of a 2D PSR plot [closed]

So I have been referring to the method of obtaining this as outlined in the following paper (pg 4 - 5): ...
-2
votes
1answer
77 views

creating mtabe using matlab [closed]

I was given the following task: . Write a function called mtable that returns mt an n-­‐by-­‐m matrix corresponding ...
-1
votes
1answer
65 views

Why is the following program not correct? [closed]

I was given the following task: Write a function called randomness that takes three input arguments: limit, n, and m, in that order. The function ...
0
votes
1answer
16 views

matlab matrix substitution without loops

below there is a task we were asked to do using matlab. I wrote this function below which works fine. But, since 'for' loops were not shown yet in the course, I think that the instructor meant doing ...
0
votes
2answers
41 views

Calculation of minimum infinity norm subject to L1 norm

Can somebody tell me how to evaluate the following in MATLAB or any other programming language? \begin{equation} \min_{x \in \partial \|w\|_1} \| x+y\|_\infty \end{equation} $x,w,y \in R^n$. $w,y$ ...
1
vote
0answers
17 views

Is there a map that maps the mean vector and the variance matrix of a multivariate lognormal to its location vector and diffusion matrix?

Suppose ${\xi} \sim logNormal_d ({\mu},{\Sigma})$, where $\mu$ is a d-dimensional vector (called location vector) and $\Sigma$ is a $d \times d$ symmetric positive definite matrix (called diffusion ...
-1
votes
1answer
39 views

Image restoration in matlab via PDE toolbox

I want to remove a noise for an image using matlab, when the observed image is $$f=u+v$$ where $u$ is the restored image (is the image i want recovered) and $v$ is the gaussian noise. To restore $u$, ...
0
votes
1answer
51 views

Numerically solving a system of partial integro-differential equations in Matlab [closed]

Given the following system of partial integro-differential equations - $\frac{dS(t)}{dt}=\Lambda-\mu S(t)-\beta S(t)F(t),\\ \frac{\partial I(t,\omega)}{\partial t}+\frac{\partial ...
0
votes
2answers
33 views

A question about the matlab error “Subscript indices must either be real positive integers or logicals” [closed]

I wrote a simple matlab code to evaluate the ground state energy of a set of tight-binding Hamiltonians with local magnetic impurities. I always encounter the subscript error until I add a new line, ...
0
votes
0answers
19 views

spline interpolation of 3 dimensional array

Iam trying to interpolate two files which are stored into array. here is the example of the files. File 1 : x y z 8 12 89 11 18 30 11 19 20 File2: x1 y1 z1 8 12 89 11 18 30 11 19 20 ...
0
votes
1answer
48 views

How can I make graphs in matlab?

for my thesis I have to include figures. I want to make a figure as the figure in the attachment, but since I am pretty new to matlab I do not understand the best way (I know this may be a many ...
0
votes
0answers
82 views

How can I resolve this improper integral?

I would like to resolve this integral numerically . However, I'm not sure about the best way to do it because it is an improper integral: $$ ...
-1
votes
2answers
23 views

How to compute the incomplete Gamma function with an negetive parameter in MATLAB?

I need to compute the upper incomplete gamma function $$\Gamma(-0.5,0.5r)$$ But in MATLAB, the upper incomplete Gamma function "gammainc" is defined as $$\Gamma\left(\alpha ; x\right) = ...
1
vote
1answer
367 views

Matlab: need help with optimization

I am trying to minimize the objective function over [x(1),x(2)]: exp(x(1))*(4*x(1)^2+2*x(2)^2+4*x(1)*x(2)+2*x(2)+1)+b subject to constraint ...
0
votes
2answers
853 views

How to calculate the hessian of a matrix function

I am estimating a model minimizing the following objective function, $ M(\theta) = (Z'G(\theta))'W(Z'G(\theta))$ $Z$ is an $N \times L$ matrix of data, and $W$ is an $L\times L$ weight matrix, ...
0
votes
0answers
22 views

Is there an efficient $O(n^2)$ way to estimate in MATLAB a matrix condition number given its LDL decomposition?

Since evaluating a matrix condition number usually takes $O(n^3)$, I wonder whether there is an efficient $O(n^2)$ way to estimate in MATLAB a matrix condition number given its LDL decomposition. ...
1
vote
1answer
37 views

Please help me in finding matlab code

How do I find the max value and the unknown variables of ...
2
votes
2answers
317 views

Find the sparse representation in matlab

I have a dictionary(Matrix) D and an input(Vector) Y. Now I want to solve this problem: What is the Sparse Representation of input Y according to dictionary D. this problem is an important question ...
1
vote
3answers
32 views

Solve for x with an expression of independent variable in the exponent

I am helping a friend in research. I wish to solve for x, in this equation. $p, k, m, l, r\text{ and }h$ are all constants. They may vary, depending on the user's input, but they would all be ...
2
votes
2answers
2k views

How I can get coefficients matrix in MATLAB from the set of linear equations?

I am working in MATLAB and having problem in extraction of coefficients out of my set of symbolic linear equations. Equations are as such ...
0
votes
0answers
44 views

Matlab Coding finding zeros without using fzero or roots function

So i am a completely new at Matlab. I'm basically suppose to develop a function in Matlab that finds the zeros of a cubic polynomial. real and complex. I'm pasting below what I have so far. I started ...
0
votes
1answer
758 views

Autocorrelation and spectral density in MATLAB

This question is twofold. We have an LTI system that is a first degree Butterworth LP filter with the power TF where fu = 110Hz and ...
2
votes
0answers
25 views

Understand and Implement adjoint operator of gradient

I have an equation as With initial ui=vi; yi=0, tau=1; I am implementing eq. 4.19 and 4.20 in MATLAB. Hence, I would like to ask you something. The adjoint operator of gradient is similar the ...
0
votes
0answers
17 views

Run fmincon with different initial value [migrated]

I have an optimization problem with a nonlinear inequality. I wrote the MATLAB code using fmincon given below. Now, I want to run the code for different initial ...
2
votes
0answers
28 views

eigenvectors of a unit lower triangular matrix

I know that for a lower triangular matrix, its eigenvalues are equal to its diagonal elements. And if we assume a unit lower triangular matrix, its eigenvalues are all equal to 1 (since it is a unit ...
0
votes
0answers
130 views

Second order coupled differential equations

I am trying to solve two coupled ordinary differential equation. $x''+Ax'+By'+Cx+Dy=U$ ; $y''+Ex'+Fy'+Gx+Hy=V$ ; $A,B,C,D,E,F,G$ & $H$ are constants, $U,V,x$ and $y$ are function of time. All ...
0
votes
0answers
19 views

multiplication between a matrix and a givens rotation

I want to multiply a matrix A with a givens rotation G. As a reference to this very important link:Click here, they explained in pages 13 and 14 how this multiplication can be achieved. In this PDF, ...
0
votes
2answers
426 views

Plot recursive signal in Matlab

I need to create and plot this signal in matlab with 2000 points: x(n) = 0.6530 x(n-1) - 0.7001 x(n-2) + v(n) Where $x(-1)=x(-2)=0$ and $v(n) =$ white noise I ...
2
votes
2answers
10k views

Creating a Tridiagonal matrix in matlab

How can I create a tridiagonal matrix that I can use for Crout factorization? And, I don't have any codes on how to create one since I am new to matlab. Ok, please help me understand what does the ...