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
13 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$ ...
-2
votes
1answer
19 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
3answers
44 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?
1
vote
0answers
36 views

A problem from eruler.net concering Factorials. [on hold]

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
24 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 [on hold]

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
41 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
38 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 ...
0
votes
0answers
19 views

Error in using Matlab detectSurffeatures [closed]

I am unable to plot the feature points . ...
1
vote
1answer
30 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 ...
1
vote
0answers
32 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
1answer
35 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
0answers
16 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
0answers
48 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$ ...
1
vote
0answers
17 views

a matlab programm computing the powers of 1/6 [closed]

the powers of $\frac{1}{6}$ are computed using the following sequence: $$ \begin{cases} \quad x_0&=1\\ \quad x_1&=\frac{1}{6}\\ \quad x_{n+1}&=\frac{37}{6}x_n-x_{n-1},\quad \forall n\geq 1 ...
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
3answers
28 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
11 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: ...
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 ...
4
votes
1answer
32 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 ...
2
votes
0answers
21 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 ...
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
19 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 ( ...
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: ...
1
vote
1answer
24 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 ...
-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
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) = ...
0
votes
1answer
16 views

how can I plot the infinite sum in matlab [closed]

I'm lookin for a way to plot $$\hat x= \sum_{n=-\infty}^\infty 0.5cos(1.3\pi n)sinc(t-n)$$ in matlab, and I can't find out how
0
votes
0answers
21 views

Singular value decomposition positive components

I am using Singular Value Decomposition (SVD) applied to Singular Spectrum Analysis (SSA) of a timeseries. ...
0
votes
1answer
23 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
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
1answer
27 views

Represent mode of a probability distribution.

I am finding it difficult to represent a simple analysis done in Matlab in equation form. The operation is of two step. Bin a data in 10 bins. (the distribution is unimodal) and then find the bin ...
0
votes
0answers
27 views

Normal form calculation

I am working on a problem involves 4 dimensional dynamical system. Is there any ready package (for maple ,matlab...) which calculate the normal form of nonlinear continuous dynamical systems? The ...
0
votes
1answer
35 views

Examples for 1d finite element method

I am looking for some examples for my Finite Elements project (in one dimension). I have written code in MATLAB and would like to show a few examples of it working. I have one or two general examples ...
0
votes
1answer
31 views

Finding derivative using matlab

Suppose I can generate infinitely many values of x and f(x). The functional form of f(x) is now known. Now I need the value of f'(x) at each point. What is the best way to find it with satisfactory ...
0
votes
0answers
13 views

transfer matrices times a real-valued matrix in Matlab

I am a beginner in matlab. My question is: I want to do the following thing: where $A,B,C,D$ are all $3 \times 3$ matrices. So the transfer matrix should be a $3 \times 3$ matrix. $K$ is a $3 ...
0
votes
1answer
48 views

Solving $y' = 2xy^2$ using backward Euler

$$ y' = 2xy^2, \quad y(0) = 1$$ The formula for backward Euler is $$ y_{n + 1} = y_n + hf(x_{n+1}, y_{n+1}) $$ Where $h$ is the step size. Plugging in for $f$ $$ y_{n + 1} = y_n + h \times 2 ...
0
votes
2answers
32 views

Approximating an integral using Monte Carlo Method

I wrote a solution for Calculate the value of the integral I = $\int_0^\pi sin^2(x)dx$ using the Monte Carlo Method (by generating $ 10^4 $ uniform random numbers within domain [0, π] × [0, ...
1
vote
1answer
35 views

Approximate an integral using Monte Carlo method

I have a question on an assignment Calculate the value of the integral I = $\int_0^\pi sin^2(x)dx$ using the Monte Carlo Method (by generating $ 10^4 $ uniform random numbers within domain [0, ...
3
votes
2answers
63 views

In a linear program, how to add a conditional bound to x?

I am working with a standard linear program: $$\text{min}\:\:f'x$$ $$s.t.\:\:Ax = b$$ $$x ≥ 0$$ Goal: I want to enforce all nonzero solutions $x_i\in$ x to be greater than or equal to a certain ...
2
votes
4answers
131 views

Find a function with certain requirements

I'm trying to find a function $y=f(x)$ that can be described as follows: $f(x) = g(x) + c/(x-x_a)$. With $f(x)$ I want to design a function with the following properties: $f(0) = 0$; $f(x)$ has a ...
2
votes
0answers
36 views

Reformulate this PDE in different notation

I would like to rewrite this general PDE \begin{equation} \alpha\partial_tu+\beta\partial_xu+\gamma\partial_{xx}u+\delta u=\varepsilon \end{equation} in this form $$c\left(x,t,u,\frac{\partial ...
0
votes
1answer
18 views

Plot my own function 'in two variables'

I have matlab function in two variables say $function_{something}(t)$ where $t$ is of size $2 \times k$, this is to allow to evaluate $k$ times in two values. So my output is then a $k \times 1$ ...
0
votes
1answer
25 views

How can you plot straight lines in Matlab using only values on x axis and the gradient of each line?

I'm trying to plot characteristics for the Burgers Equations. But I have to plot them only using the inbuilt function plot. It seems like a fairly straight forward problem but I still cant solve it
6
votes
0answers
52 views

fixed point iteration

I am trying to find the root of $f(x)=\arctan(x)$ by using successive iteration. There are some conditions to apply this in successive iteration . 1) The function has to be continuous. 2) ...
0
votes
1answer
13 views

How do I discretize a parabolic partial differential equation?

I have the following homework question: To keep my long sob story as short as possible, my awesome applied numerical methods teacher had a personal emergency and is replaced for the rest of the ...