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
0answers
18 views

creating a loop and maybe a potential loop within a loop in matlab [on hold]

I'm extremely new at Matlab so would like some help. I'm trying to create a loop and maybe a loop within a loop, I'm not too sure at the moment but here's what I'm trying to achieve. I began with ...
0
votes
0answers
16 views

Nested symsum and symprod.

I am trying to use fmincon to find the values of $w_j$ which minimize the following monster (wherein t is a known constant): $$\...
0
votes
0answers
7 views

Parabolic cylinder function implementation using Matlab? [on hold]

I would like to ask about the implementation of the Parabolic cylinder function using Matlab?
1
vote
0answers
13 views

Doubt about SVD algorithm

I am studing the SSA (Singular Spectrum Analysis) algorithm and after reading some papers about SSA, the ideia was not consolidated. I found a Matlab SSA algorithm here and I was trying to implement ...
2
votes
2answers
40 views

Maximizing a convex quadratic function in CVX and Matlab

I understand that a convex function can not be maximized as there is no such value. However, consider the following function: $$\begin{array}{ll} \text{maximize} & 3x^2 + 5y^2\\ \text{subject to} ...
0
votes
0answers
18 views

Exponential curve fit with MATLAB's fit function does not deliver good fit

I am trying to use MATLAB's fit function to fit a curve through a data set which obviously shows an exponential decay. These are the commands I use: ...
0
votes
1answer
41 views

Comparing $f(x)$ and the $f\_approx(x)$ in Matlab, Octave or Mathematica/Wolfram

I have a function $f(x)$ and I wrote the approximation for $f(x)$ as $f\_approx(x)$ which is a simple algebraic formula with sums and products . I now want to study the 2 functions side by side and ...
-5
votes
0answers
49 views

Second Derivative in Matlab [closed]

I have a set of data and How do I calculate the second derivative? Below some sample data of x and y form x=[0.1;0.07;0.05;0.03;0]; r=[-98.9407;-105.7183;-111.2423;-116.0320;-120.0462];
-2
votes
0answers
12 views

Contour plot on MATLAB [closed]

I'm trying to generate a contour plot of this function $$\rho = \frac{1}{2\pi(R^2+(1+\sqrt{z^2+0.4})^2)^{3/2}}$$ using MATLAB. I've defined a mesh grid [R,z] = meshgrid(-10:0.1:10, -10:0.1:10); and ...
0
votes
0answers
26 views

matrix multiplication result value range

Here is the initial question: About the output value range of LeGall 5/3 wavelet Today I found actually the transform can be seen as a matrix multiplication. It is easy to calculate the wavelet ...
1
vote
0answers
19 views

The range of the coefficients of 2 level Wavelet LeGall 5/3 2D transform

As in the title, I am confused about the range of the coefficients of Wavelet LeGall 5/3 (has to be exact this filter) 2D transform (only for a 8*8 block) if the value of the input matrix are within ...
0
votes
0answers
13 views

Continuously Delayed DDE

I am interested in solving numerically a system of six differential equations of the form: $$\frac{d\psi_{i}}{dt}=f(\psi_{j=1,...,6},\int_{t-\tau}^{t}\psi_{i}(t')dt')$$ I have read about DDE's (...
1
vote
1answer
19 views

The problem of ksdensity plot in Matlab

I want to verify that random numbers generated by exprnd match the exponential distribution. I used Matlab's ksdensity function –...
1
vote
0answers
15 views

Zero-centering a kernel matrix?

I'm trying to implement the algorithm in this paper. As you can see at page 4, it is explained how to 0-centering a pxp symmetric Kernel matrix ...
0
votes
0answers
17 views

Operator Splitting, Piecewise Function, ODE,PDE,Matlab code [duplicate]

$t_f=1$ $$y(t) = \begin{cases} e^{2t},& 0 \le t \le t_f/2 \\ 2\left(t-\frac{t_f}{2}\right)+e^{t_f} , & t_f/2 \le t \le t_f \end{cases}$$ How can i write this piecewise function in ...
0
votes
1answer
13 views

Square Root of a matrix: transpose or inverse of eigen vectors?

Here is described that the square root of a matrix is defined as K^1/2 = V*D^1/2*V^-1 At the end of scetion 4 of this paper we can see W = K^-1/2es In the ...
2
votes
0answers
30 views

how to use matlab to calculate double integration?

I want to use Matlab to verify the result of double integration. $$\int_{-w}^{w}\int_{l}^{x}e^{ay}\space dydx$$ I tried this one ...
0
votes
0answers
11 views

Fitting to a convolution function in MATLAB

I have a set of spatial intensity curves that I believe arise from the convolution of a flathat beam intensity profile with a normal distribution curve (or set of normal distribution curves) that are ...
0
votes
1answer
25 views

using pinverse vs gauss-jordan to solve a possibly singualr system of linear equations?

so i have a possibly singular coefficient matrix A . (it's sometimes singular and sometimes not !) (in the case of singularity it has many solutions we only need one) i know using an inverse to find ...
0
votes
0answers
8 views

Reassembling a matrix from submtrices in MATLAB

Here I have an image X defined as follows: X=imread('sunset.jpg'); So X is a matrix. Now I subdivide the matrix into $8\times 8$ submatricse as follows: $$B = mat2cell(X(:,:,1), 8*ones(1,...
0
votes
1answer
15 views

Passing variables into function (MATLAB)

I am creating a function that perform multiple regression in MATLAB. The function is created as function [Beta] = george_linreg(y,x1,x2,x3,....,xN). I don't ...
0
votes
1answer
46 views

Why is cos and sin used in plotting this phase portrait

I'm plotting the phase portrait of the following system of ODE: $\frac{dx}{dt} = x + 3 y$ $\frac{dy}{dt} = -5 x + 2 y$ The code I have in matlab: ...
-1
votes
0answers
25 views

How to find the maximum of an implicit function in matlab

I have an implicit function with 2 variables x(1) and x(2). The variable x(2) can not be written explicitly in terms of x(1). I would like to find the value of x(1) that maximizes x(2). The implicit ...
1
vote
1answer
84 views

how to solve $ \int \frac{ e^{4cy^3+2by^2 + (a-3c)y - b}} {\sqrt{1-y^2}} dy $?

here $a,b,c$ are constants it can be solved as indefinite integral or a definite integral with limits [-1,1] or [0,1] MATLAB is not helping here
0
votes
0answers
13 views

Unknown normalization

I am trying to do BPP imaging and have been trying to replicate the algorithm in "Photoplethysmographic imaging of high spatial resolution" however I've ran into a problem. They say they normalize ...
0
votes
0answers
9 views

How to put constraint on the rank of a matrix to be completed using CVX toolbox [migrated]

I would like to complete a matrix using cvx toolbox in MATLAB. For example: ...
1
vote
0answers
54 views

Finding the roots of a nonlinear equation

Hello I am trying to find the real root of this equation \begin{equation} \mathrm{x}-\mathrm{y}-\frac{\mathrm{j}\,{\left(4\,{\left(\mathrm{t}+\frac{\mathrm{a}}{\mathrm{j}}\right)}^2+\frac{4\,\mathrm{v}...
0
votes
0answers
16 views

How do I plot this second order distribution in matlab?

http://imgur.com/ChrocF9 I'm trying to do a problem for heat transfer. I understand what's going on conceptually, but it wants me to do a 2D temperature plot in Matlab and I am stuck. The symmetry ...
0
votes
1answer
35 views

Expected value is equal to $\infty$?

Given the following set: $$ M=\{2^k | k \in\mathbb{N}_{>0}\}=\{2,4,8,16,...\} $$ Now we chose randomly some elements. For this we have to define a distribution: $$ P(m\in M)=m^{-1} $$ As can be ...
1
vote
2answers
77 views

integration of exp(cos(x-a)) dx

I would like to compute either of the following integrals: $$\int e^{\cos(x-a)} \, dx$$ or $$\int_{-\pi}^{\pi} e^{\cos(x-a)} \, dx$$ In both cases, $a$ is a constant. MATLAB doesn't seem to be ...
0
votes
0answers
38 views

How to integrate discrete data by Gaussian quadrature method

I'm trying to numerically integrate discrete data by Gaussian quadrature method. The file attached test.mat is a discrete data set taken from a finite-element mode ...
0
votes
0answers
10 views

MIMO static decoupling matrix

I am trying to implement a static decoupling matrix of a MIMO system in MATLAB Simulink. This static decoupling matrix is of size 2x2 with some complex numbers, and the control scheme used for ...
0
votes
0answers
16 views

How many eigenvectors can a real, symmetric, sparse matrix have?

I'm attempting to diagonalise a sparse, real and symmetric matrix H in MATLAB, using [F, E] = eigs(H, size(H,1)). This however ...
1
vote
2answers
62 views

How to calculate matrix rotation

Given the following rotation matrix $$\left[ \begin{matrix} -1/3 & 2/3 & -2/3 \\ 2/3 & -1/3 & -2/3 \\ -2/3 & -2/3 & -1/3 \\ \end{matrix} \right]$$ ...
1
vote
0answers
24 views

Matlab double integration result does not match with my self calculate

Here is a double integration, self learning $$ P=\int_{-w}^{w}\int_{l}^{\frac{y_h(x_b+w)}{x_h}+l}\frac{1}{2}\operatorname{erfc}\left[\frac{\log{\frac{z_h(y_b-l)}{y_h}}-\mu}{\sigma\sqrt2}\right]\space ...
-1
votes
1answer
62 views

How to implement twice MATLAB integral build-in function for numeric integration? [closed]

Suppose we have a function $F(\lambda) = \int\limits_{\lambda}^1 f(x) dx$, where $f(x)$ has no formula for antiderivative. We can easily calculate it by means of build-in MATLAB functions. Let's use $...
0
votes
0answers
28 views

Plotting $\sum_{n\geq 1}\frac{1}{n}z^{n}$ for $|z|<1$ (the natural boundary): Coding

As part of my tutorial, I would like to show the plots of a)$-\sum_{n\geq 1}\frac{1}{n}z^{n}$ and b)$Log(1-z)=log(|z|)+iArg(z)$, to drive home the point of analytic continuation. Plotting the Log is ...
1
vote
1answer
23 views

Plotting flux tubes on the surface of a sphere on matlab

I've been given the task to plot two flux tubes on a surface of a sphere, where one of the tubes twists around the other (to model magnetic helicity). I know how to generate a sphere in Matlab, and ...
0
votes
0answers
9 views

Specifying Correlation Within Clusters

So, I am looking to generate data which is correlated at a group level with a specified level of correlation. That is, suppose if I drew a certain number of $y_{ig}$ observations from the standard ...
3
votes
3answers
70 views

Find equation for line segment

I already know that the standard equation for a line is $y=mx+b$, but what if i want the line to have specific endpoints and not go on forever. For example the equation for a line beginning at $(3,1)$ ...
2
votes
3answers
189 views

Minimizing $\|Ax\|_2$ subject to $\|x\|_2 = 1$

I have a Matlab program to estimate a vector $x$ from noisy measurements. I use the singular value decomposition (SVD) to solve the linear equation $Ax=0$ (where the number of equations is greater ...
0
votes
0answers
15 views

How to get best fitting model decision for data X and Y in e.g. Matlab?

I have two sources of data, X and Y, which are basically counts, from 23 individual origins (3D ROIs in my case). For example: ...
0
votes
0answers
9 views

Phase correlation vs. normalized cross-correlation

In 2-dimensional discrete signal analysis (specifically image processing), a definition I found for the normalized cross-correlation between two images, both of size MxN $g_1(x, y)$ and $g_2(x, y)$ is:...
0
votes
0answers
23 views

Design with Matlab the equation of the position of a drone

I want to design with Matlab the equation of the position of a drone which is $u=m(\ddot z_{des}+K_pe+K_v\dot e+g)$ where $e$ and $\dot e$ can be calculated from the current and desired states $(z,...
0
votes
0answers
22 views

How to find the result of a differential equation in Matlab?

Given a variable $x$ defining the position of a drone, $\dot x$, its velocity, how do we find its acceleration $\ddot x$ in mathlab? I know that we can found the solution of a differential equation ...
0
votes
0answers
19 views

what is the ZYZ euler angle representation,(ψ, θ, ϕ), for a given matrix in MatLab?

I want to know using matlab what is the ZYZ euler angle representation,(ψ, θ, ϕ), for the following rotation matrix? \begin{pmatrix}0.6927&-0.7146&0.0978\\ \:0.7165&0.6973&0.0198\\ \:-...
1
vote
1answer
47 views

How to verify that a matrix is a rotation matrix in Matlab?

Using Matlab, I want to know if $$A=\begin{pmatrix} \cos(x) & \sin(x)\\ -\sin(x) & \cos(x) \end{pmatrix}$$ is a rotation matrix. Hence, $$\begin{pmatrix} \cos(x) & \sin(x)\\ -\sin(x) &...
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
38 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....