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
2answers
897 views

Simulating Diffusion/Wiener Process with Random Walk

I hope this is the right section for this kind of questions. I am trying to simulate, with MATLAB, a diffusion model starting from a Random Walk. I am using a Random Walk with information increment ...
0
votes
2answers
539 views

Matlab upper and lower triangular matrix

I created an upper triangular matrix in U and a lower triangular matrix L from A matrix but when I go to make the inverse procedure in order to take my original matrix the matlab returns the right ...
0
votes
1answer
33 views

With rows have a -1 in its third column? (matlab)

Let me explain my question with an example. I have the matrix $\begin{pmatrix}0 &5 &1 \\ 0&5&-1 \\ 10&-55&2 \\ 4&0&-1 \\ 1&1&1 \\\end{pmatrix}$ and I need to ...
1
vote
1answer
37 views

Question about a matlab matrix

To explain my problem I goint to show a little example. I have a matrix K $K=\begin{pmatrix}k_{11}&k_{12}&k_{13}\\ k_{21}&k_{22}&k_{23}\\ ...
1
vote
2answers
167 views

Calculate maximal island of ones in a matrix

I have came up with a problem involving matlab and matrices with entries 1 or zero. The matrix represents people in a footballstadium, doing a wave. If a person does the wave, he has a one in the ...
0
votes
1answer
39 views

Basis of a matrix with zero rows

I'm trying to check whether B is a basis for $\mathbb{R}^m$. If B is not a basis, I want to use the matrix eye(m) from matlab to create a basis for $\mathbb{R}^m$ that will contain all vectors from B ...
1
vote
1answer
159 views

Good software package to help Maths learning

I'm a mature student enrolling at a Maths degree course soon at the university. I'd like to be able to use some software package to help me visualize equations, graphs, play around with variables with ...
1
vote
1answer
128 views

Distribution of a sample generated from an AR(2) model

Consider the autoregressive model of order 2 $$X_{t}=\varphi_1X_{t-1}+\varphi_2X_{t-2}+\varepsilon_t,$$ where $\varepsilon_t$ are zero-mean normally distributed random variables with $\sigma^2$ ...
1
vote
1answer
356 views

Matlab ode45 numerical solution

I'm trying to solve a 2nd order differential equation, using the Runga Kutta's ode45 function in Matlab. It's for a bachelor project, where I'm trying to simulate the behavior of a spherical robot, ...
1
vote
1answer
695 views

How to draw a circular 3D plot in matlab

I want to plot this function in matlab : sin(4*x)*cos(4*y) on a disk This is how i proceeded : syms x y; f=@(x,y) sin(4*x)*cos(4*y); ezmesh(f,'circ') This method works with f=@(x,y) ...
0
votes
1answer
60 views

Function Plotting in Matlab

I m new to Matlab and I need it for my senior seminar project. How would I plot a function of the form $x_{i+1}=f(x_i), \;f(x)=rx(1-x)$, for x=linspace(0,1) and some $\;r$? I m supposed to plot x as a ...
2
votes
1answer
88 views

Similarity between two curves

I am trying to find out how well a deterministic version of a MATLAB program predicts the stochastic version. I don't know what statistical test/quantitative analysis to use. This is what the output ...
0
votes
1answer
171 views

Givens method for sparse matrix

I have to solve a linear equation system, Ax=b, where A is a (very) large sparse matrix (compressed sparse column form). From what I've read I think I'm supposed to use Givens method, but I don't ...
1
vote
1answer
133 views

Markov chain problem, Help!

I am stuck on this question for a long time Question: Consider 4 balls, labelled from 1 to 4 and distributed amongst two urns (Urn 1 and Urn 2). At each time $n>1$, a number from 1 to 4 is chosen ...
0
votes
2answers
48 views

Minimization Problem in Matlab regarding vector equation

How can I minimize for b in the equation f(b) = norm((b*a+c),2) when b is a scalar and c, a are vectors (Nx1)? I tried: ...
0
votes
1answer
1k views

Matlab code for logistic map bifurcation

Take the logistic map $$x(i+1) = f(xi), f(x) = rx(1 − x)$$ Find numerically the $r$ values for the first two bifurcations. I know I have to set $f(x)=0$, solve for $x$, and then use the $x$ values ...
0
votes
1answer
39 views

Can I use fft of Matlab in this case?

fft is a function for Fast Fourier transform. In Matlab help document, Y=fft(x), $\rightarrow$ $X(k)=\sum\limits_{j=1}^Nx(j)w_N^{(j-1)(k-1)}$ where $w_N=e^{(-2\pi i/N)}$ and $N$ is the length of $x$. ...
0
votes
1answer
36 views

derivative of the exponential integral

I have one function that is defined: $$E_x(f)=\int K_\sigma(y-x) \cdot e^{-a\cdot f(y)} \, dy$$ where $y$ is neighboor points of $x$; $f(y)$ is a function of $y$; and $a$ is constant. I want to ...
0
votes
1answer
84 views

Logistic Equation with MatLab

I want to write a MatLab file that can solve the following logistic equation: $$\frac{dN(t)}{dt} = [a-bN(t)]N(t) \;\;\;\; a>0, b>0$$ But I'm not sure how to go about it. Are there any examples ...
1
vote
1answer
1k views

Affine Transformation matrix for mapping a triangle to another

I'm trying to write a function in Matlab that will give me a matrix T that can be used to multiply points in homogeneous coordinates. This is achieved my mapping a ...
0
votes
1answer
193 views

Generate matrix of random number with constraints

I want to generate a matrix of random numbers (normrnd with mean == 0) that satisfy the following constraints using MATLAB (or ...
0
votes
1answer
42 views

About a matlab mathematic problem from applied numerical method

Can you help me,please to solve this problem with the help of Matlab. Thanks!
0
votes
1answer
80 views

Constructing a similarity matrix between points

I have two images with two sets of corresponding points. In order to align the images I'm trying to compute the similarity matrix that describes the relationship between the corresponding points. I ...
0
votes
1answer
204 views

Obtaining useful information from graph obtained via Monte-Carlo Simulations

I've been running Monte Carlo Simulations on some Matlab code and then plot the graph shown below. I was just wondering what useful information I could collect from this graph? Edit: fit ...
4
votes
0answers
119 views

Matlab's dwt2 in publication quality notation?

I used Matlab's dwt2in my algorithm, what notation have you folks seen that describes the 4 resulting wavelets? How do I express ...
0
votes
1answer
124 views

MatLab: estimate number of iterations

I want automatically estimate iterations number in matlab. Suppose we have for(int i = 1; i < N; i++). It's clear that for-loop prodices ...
1
vote
0answers
115 views

using lsqcurvefit to fit piece-wise linear

I would like to use this function to fit piece-wise linearly to a set of data. Namely, I want to fit them with several linear segments. Including other requirements, I would not want the segments ...
0
votes
1answer
25 views

MATLAB: How to make a list of words in matrices?

Cross-posted from stackoverflow, where there seemed to be no interest: http://stackoverflow.com/questions/22329233/matlab-how-make-a-list-of-words-in-matrices Given two n by n invertible matrices A ...
0
votes
1answer
196 views

Subtract matrices of different sizes

I have 2 matrices of different sizes, say A - 8*3 and B - 2*3. I need to subtract from each row of B, a particular row of A and sum these values. This I need to do for all the rows for A and store the ...
0
votes
1answer
88 views

Prove relative error with condition number of matrix inequality

I was working on some questions and solutions, and encountered the following question. I am able to prove the inequality using the given information and some algebraic manipulation but the "within ...
2
votes
2answers
120 views

Matlab terminate code if warning occurs [closed]

I am running a code where by I want to maximise a parameter (basically the range of integration) by increasing it in steps until a warning occurs. It involves inverting a linear system Ax=b and I want ...
0
votes
1answer
60 views

Matlab: plotting y against f(y) [closed]

I am learning about Matlab and autonomous differential equations and have been trying to plot the graph of y against $f(y)$ for the logistic equation but it doesn't seem to come out right. this is ...
0
votes
2answers
1k views

Solving system of equation with many variables and parameters

I wonder if there is any way how to made MATLAB solve the system of equation as this: $ s\cdot x_1 = \frac {R_1L_2}{M^2-L_1L_2} x_1+ \frac {MR_2}{M^2-L_1L_2} x_2+\frac {M}{M^2-L_1L_2} x_3 - \frac ...
3
votes
5answers
863 views

Round a set to the nearest values in another set (2D), faster algorithm with Matlab

Given a set of numbers, like A={{1,2.5,3}, {4.2,7,10}}; and another set of numbers, like B={1,2,3,4,5}; Is there a fast ...
0
votes
2answers
1k views

How to find (and plot) a probability distribution function?

I'm working on my biometrics course, and I have to plot a pdf (I think it means probability density / distribution function). Here is a sample pdf graph : Introduction to Biometrics page 5 , figure ...
2
votes
1answer
355 views

Matlab help related with discretization of second order elliptic partial differential equation

I am reading this paper. In Example 2 from this paper, linear system of equation $Ax = b$ is given, where coefficient matrix $A$ has been generated by he five-point discretization of the following ...
0
votes
1answer
322 views

Generating Different types of Matrices in Matlab

I am working on a project for a numerical methods class comparing two iterative methods for solving $Ax=b$, and I was wondering what type of functions Matlab has for generating arbitrarily large ...
0
votes
1answer
2k views

Getting wiener filter coefficients in Matlab

I need to find two coefficients (w1,w2) for a wiener predictor filter of the signal x(n)=0.65x(n-1)-0.7x(n-2)+v(n) where: ...
0
votes
2answers
445 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
345 views

MATLAB determining elementary matrices for LU decomposition

I am confused by this question I am studying for MATLAB practice.
0
votes
1answer
391 views

Is my implementation of FastICA right?

I have written the following code to perform ICA on the mixed signals that were generated using a random mixing matrix. But the performance of the algorithm is not satisfactory. Did I do something ...
1
vote
1answer
83 views

Algorithms for non-random but equidistributed ways to fill up a Cartesian plane

In pages 90-91 of this book the authors talk about uniform, but not necessarily normally distributed random ways to fill up a Cartesian grid. For example, in the attached images. These are the ...
1
vote
1answer
995 views

Using Runge Kutta 2 on a System of Equations

So I created a MatLab code to solve an ODE equation, however I'm having a hard time vectorizing everything! Here is the code as I have it: ...
0
votes
2answers
792 views

Laplace equation in 1D with MATLAB - Neumann boundary condition

My previous problem is here and I 've done. Laplace equation in 1D with MATLAB I have the next problem: solve Laplace equation in $1$D with boundary condition $u'(0)=u'(1)=0$ Help me some hints. ...
0
votes
1answer
106 views

MATLAB Finding Difference of two equations

So I'm trying to figure out how to do a fairly simply mathematical task in MATLAB but I don't know what it is called so I don't know what to search. Basically what I want to do is if you have two ...
0
votes
1answer
936 views

Laplace equation in 1D with MATLAB - Dirichlet boundary condition

Here is a Matlab code to solve Laplace 's equation in 1D with Dirichlet's boundary condition u(0)=u(1)=0 using finite difference method ...
0
votes
1answer
1k views

PCA using SVD in Matlab, a few questions.

I have X = [25, 2000] i.e. 25 subjects and 2000 values (i.e. each subject has a spectrogram that is reduced to 2000 values). My goal is to reduce from 25 subjects to 1 or 2 "subjects" that best ...
1
vote
0answers
148 views

Solving a Large band system using Gauss-Seidel Iteration

Sorry for my english. I have to solve the following band system using Gauss-seidel iteration program in matlab. $$ \begin{array}{cccccc} 12x_1&-2x_2&+x_3&&&=&5\\ ...
0
votes
2answers
45 views

Ordinary differential equations with signed first derivative

Consider the following coupled set of ordinary diferential equations: \begin{align} (K_{pa}+K_r)y_1(t)-K_ry_2(t)+C_0\operatorname{sign}(\dot{y}_1(t))\lvert\dot{y}_1(t)\rvert^\alpha &= ...
0
votes
3answers
110 views

Matlab code has a systematic error

I have the following code to calculate the number of real eigenvectors of a normally distributed matrix: ...