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
votes
0answers
4 views

Computing the PMF and CDF for the Poisson-Binomial Distribution using DFT-CF

I'm using MATLAB to compute the PMF and CDF for the Poisson-Binomial distribution. I'm implementing the algorithm shown in this paper http://www.sciencedirect.com/science/article/pii/S0167947312003568 ...
2
votes
1answer
63 views

How can we represent an image using basis images?

I have read that using Fourier transformation we can decompose any arbitrary image into orthogonal basis images and reconstruct it back. Mathematically how basis images are represented using Fourier ...
0
votes
1answer
33 views

How to solve over-determined linear system of equations?

at the moment I am working on an application where I have to solve some systems of linear equations during the whole algorithm. Because the programming-language I have to use is something related to ...
0
votes
1answer
325 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 ...
0
votes
1answer
293 views

Determining the direct and transverse tangent lines for two non-overlapping ellipses

I am trying to determine the direct and transverse lines for two non-overlapping ellipses. I specifically mean that the two ellipses are totally separated from each other with no shared regions. I ...
1
vote
0answers
29 views

How should I rewrite this code to not use feval? [migrated]

I recently finished a homework set in my Applied Numerical Methods class and did alright on it. However, my professor made a note to say I shouldn't use the feval() function because it's outdated. ...
1
vote
0answers
6 views

0ut-of-sample variance (rolling window)

My objective is to calculate out-of-sample variance of various portfolios. I am currently working on the comparison of the constructed portfolios using out-of-sample variance criteria. I am going to ...
2
votes
2answers
118 views

LSQR with matlab

I am trying to use LSQR on matlab to solve a linear equations: $$ aX + bY = Z $$ so I form [a b][X Y]' = Z where a, b and ...
0
votes
0answers
20 views
0
votes
0answers
30 views

probability of collision approximation,matlab,maple

I'm working in the field of communication network. I have this equation p=((1-(1-(((2.*(1-2.p))./(1-p-p.(2.p).^m)).(1./Wi))).^(n-1))) I want to solve for p, but I failed(maple and matlab), can ...
0
votes
0answers
38 views

Phase vocoder equation

I know I can adjust the frequency of a waveform using a modified version of the sine wave equation $$\mathrm{amplitude}\times\cos(2\pi\times\mathrm{frequency}\times\mathrm{time}+\mathrm{phase})$$ ...
1
vote
0answers
20 views

MatLab Single Value Decomposition [on hold]

there is an error in this code that I cannot seem to find. I am trying to take a simple black and white image and preform single value decomposition on it. Here is the code I am trying to use. Link to ...
1
vote
0answers
14 views

create zero-order hold in matlab [on hold]

I'm trying to create a zoh of a given signal, but the plot is weird. here's what I've done: given that: $|X(w)|=0 for |w|\ge7.5\pi$ ...
1
vote
3answers
49 views

Converting nonlinear second order ODE to first order

The second order ODE is: $$ y'' + ky' + (mg/c)\sin(y) = 0 $$ $k$, $m$, $g$ and $c$ and constants. What is the first order ODE and how do I do it?
-2
votes
1answer
21 views

Create matrix of coefficients in matlab

I have written a function that creates a matrix based on a polynomial of a given degree. I will ultimately use this to fit data, but the problem I am having is that I can not find a good way to create ...
1
vote
0answers
45 views

A problem from eruler.net concering Factorials. [closed]

Saw this problem on eruler.net. Find it really intriguing but I'm really stuck. Just started learning myself MatLab. Any help will be much appreciated. The number $145$ has an interesting property ...
1
vote
0answers
28 views

Minimizing Sum of Least Squares in Matlab

I am working on this minimization problem for image warping that I want to solve in Matlab: Each feature $p$ can be presented by a 2D bilinear interpolation of the four vertices $V_p = [v_p^1, ...
-1
votes
1answer
13 views

Matlab, given data in matrix form 550x2, need to find the period of signal [closed]

By using Matlab, I have adata in matrix form 550x2, need to find the period of signal by finding two maximas and finding difference between their x-axis location.
0
votes
0answers
11 views

Total path lengths in MST in MATLAB

I have an adjacency matrix of MST of size (1200x1200) and I wish to find the total path lengths among nodes. I tried to use Dijkstra's algorithm for finding the total path lengths among the nodes. If ...
2
votes
1answer
42 views

How can I compute $\frac{exp(\lambda v_j)}{\sum_{i=1}^n exp(\lambda v_i)}$ in a stable way?

Given an $n$ vector and $\lambda$ > 1e4 I wish to compute this sum $$\frac{exp(\lambda v_j)}{\sum_{i=1}^n exp(\lambda v_i)}$$ for a fixed $j \in \{1, \dots, n\}$. The sum should be less than one, ...
0
votes
1answer
24 views

How to find the $H_2$ norm of MIMO system in matlab

$K$ is given. $A,B_1, B_2, C_1, C_2, D$ are also given. I want to find the following: $P_{11}, P_{12}, P_{21}, P_{22}$ And use the resulte in 1., to find the $H_2$ norm of the system: ...
2
votes
1answer
25 views

Where can I find an algorithm to compute $\min_{x \in \Delta_n} \langle g , x - y \rangle_1 + c\lvert x - y\rvert_1^2$?

I wish to compute the minimizer of $$ \min_{x \in \Delta_n} \langle g , x - y \rangle + \frac{c}{2}\lvert x - y\rvert_1^2$$ where the subindex $1$ indicates that the norm is the $1$-norm and ...
0
votes
1answer
39 views

Maximum likeliood estimation of variances of transformed variables

I use MATLAB's fminunc function in order to find the minimum of a negative log-likelihood function $f(\overrightarrow{\theta})$, parametrized by 3 parameters lets say ...
1
vote
1answer
27 views

$H_\infty$ norm of a transfer function by Matlab

Consider the simplest case: $$H(z) = \frac{z+1}{z+2}$$ I use two methods to find $H_\infty$-norm: ...
0
votes
0answers
21 views
1
vote
1answer
32 views

Matlab code for Jacobian and nonlinear function

Write the nonlinear system $x_1^3-2x^2=2$ $x_1^3-5x_3^2=-7$ $x_2x_3^2=1$ in the form $f(x)=0$. Compute the Jacobian J(x). Create the files sys.m and sys_jac.m that ...
0
votes
1answer
36 views

The Fourier transform of exp(-x)*heaviside(x)

I'm trying to understand the Fourier transform of Y=exp^-x. Since the term tends to -infinity I have to multiply Y by the heaviside function to set everything below 0 to 0 so I can successfully ...
0
votes
1answer
296 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
0answers
33 views

How can I interpolate the following data and get the equation?

I want to interpolate between three vectors which have 8 rows in each. For eg. X = [1 2 3 4 5 6 7 8], Y = [7 8 9 10 11 12 13 14 ], Z = [15 16 17 18 19 20 21 22] I want to find the equation Z = ...
0
votes
0answers
17 views

Root locus vs Matlab's root locus function

Today during a lecture out teacher was demonstrating Matlab's rlocus function, but before that he decided to do it on chalkboard. Below we have a simple transfer ...
1
vote
1answer
26 views

Displaying images on Matlab.

I'm working on image denoising problem and I have develop an optimization algorithm in Matlab for this prupose. The images are in a 256 grey level scale so mathematically what I have is a map from ...
1
vote
3answers
102 views

Maximizing the fraction of two integrals using matlab

Good day, I've run into an issue in solving a certain problem with matlab, and I was hoping if anyone could help me out. I am relatively new to matlab, so I don't even know if this is possible, but ...
2
votes
2answers
1k 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 ...
74
votes
11answers
56k views

What should I learn first, Mathematica or MatLab? [closed]

I have a non-professional interest in math and I would like to be able to be curious and play around with some math that I'm learning about (both here and from calculus-and-higher level math classes). ...
1
vote
0answers
52 views

solving PDE with state-dependent boundary conditions

I am interested in solving the following PDE (heat equation): $$\frac{\partial u}{\partial t} = \kappa \frac{\partial ^2 u}{\partial x^2}$$ In order to solve it, I discretize space uniformly into $N$ ...
0
votes
0answers
19 views

How to wrap 2D image around a circular arc?

How to transform rectangular image to image that is bent at certain radius? On the plot the center line follows the radius which is 2. Conformal transformation would be this, but there should be ...
2
votes
0answers
27 views

Evaluating a triple integral in Matlab using the trapezoidal rule

Can someone please explain to me how evaluate a triple integral in matlab using the trapezoidal rule. I have to evaluate a triple integral with six digits of accuracy and these limits: $0\leq x ...
0
votes
1answer
280 views

Matlab: Matrix with variable number of of columns

in Matlab, I want to define a Matrix A showing portfolio weights over a number of time periods N. Each period has one column in the matrix, so it needs to have N columns, and I need to code this ...
0
votes
3answers
31 views

Applying numerical integration twice (trapezoidal rule)

This is basically a programming exercise in matlab but I do not understand the math behind it. Say, that I have an ...
0
votes
0answers
14 views

two parameter bifurcation diagram using matcont

I am on my final project and I am trying to create bifurcation diagram using matcont. I tried over and over again but I cannot create bifurcation diagram as shown in the paper I cite. The upper ...
0
votes
0answers
13 views

Fourier Series from a simple sinosoidal function

I have a function of: Vd = (Rd/(33e3+Rd))*(Vrf*sin(Wrf*t)+Vlo*sin(Wlo*t)); y_t = 11*Vd; func_ = y_t; where: ...
4
votes
1answer
33 views

How can I compute $\sum_{i=1}^n x_i \log(x_i)$ in a stable manner?

Given a vector in $\mathbb{R}^n$ I have an algorithm to compute $$\sum_{i=1}^n x_i \log(x_i)$$ However for my application the norm of $x$ must be 1, hence for big $n$ the components tend to be too ...
1
vote
1answer
26 views

Find local truncation error

We have the method $$ y^{n+1}=y^n+h \cdot [\rho \cdot f(t^n,y^n)+(1-\rho) \cdot f(t^{n+1},y^{n+1})] ,\quad n=0,\ldots,N-1 \\ y^0=y_0 $$ I have to calculate the local truncation error for the method ...
2
votes
1answer
43 views

How to write ODEFUN's with y prime's? [closed]

I'm attempting to solve: $$ y'' = 3y-2y' $$ My work is basically... $$ y' = u $$ $$ u' = 3y - 2*y' $$ Now, I'm trying to write a solver for ODE45... but I can't figure out how I should write the ...
1
vote
0answers
38 views

Frequency of non-increasing and non-decreasing subsequences in Matlab

Having a sequence of numbers of length L, I need to count how many non-decreasing and non-increasing sub-sequences of exact length are there. For example, if I have a sequence of length 15 $$2, 4, ...
0
votes
0answers
21 views

how to solve ordinary differential equations with time varying delay in matlab?

I have to solve a system of ordinary differential equations of the form: d x[t] = A * x [ t ] + Ad *x[ t- d ( t ) ] where the delays d(t) its also time dependant and is given by d ( t ) = round ( ...
2
votes
3answers
124 views

Numerical estimates for the convergence order of trapezoidal-like Runge-Kutta methods

I have to calculate approximations of the solution with the method $$ y^{n+1}=y^n+h \cdot [\rho \cdot f(t^n,y^n)+(1-\rho) \cdot f(t^{n+1},y^{n+1})] ,\quad n=0,\ldots,N-1 \\ y^0=y_0 $$ for various ...
-1
votes
0answers
15 views

Solving Quartic Functions in Matlab

Is there a function or script to download for solving Quartic Formula? by a function, I mean the analytical solutions and not as an optimization problem.
0
votes
2answers
710 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
10 views

Power series expansion of a transfer matrix in Matlab

As an example: $$H(z)=\left[\begin{matrix}\frac{3}{z+3} & \frac{5}{3z+3} \\ \frac{3}{z+4} & \frac{5}{2z+1} \end{matrix}\right]$$ How to use matlab to write $H(z) = ...