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

diffusion equation plot (matlab or maple)

The advection diffusion equation is the partial differential equation $$\frac{\partial C}{\partial t} = D\frac{\partial^2 C}{\partial x^2} - v \frac{\partial C}{\partial x}$$ with the boundary ...
0
votes
0answers
4 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 ...
2
votes
1answer
542 views

MATLAB determining elementary matrices for LU decomposition

I am confused by this question I am studying for MATLAB practice.
0
votes
0answers
12 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 ...
0
votes
0answers
28 views

How to represent $GF(q)$ element in Matlab [on hold]

Everyone, I am trying to simulate in Matlab the Galois field $GF(q)$ where $q$, for example, is $8$. I know the elements of $GF(8)$ are $0,1,\alpha,\alpha^2,\alpha^3,\ldots,\alpha^6$. Also, we can ...
1
vote
2answers
54 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]$$ ...
0
votes
2answers
781 views

Overlaying scatter points over world map in MATLAB [on hold]

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 ...
1
vote
0answers
22 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 ...
0
votes
0answers
9 views

How to crop a matrix/array based on a condition [on hold]

I have a matrix consisting of 10 columns/arrays. First 9 are my data. The 10th column/array is a "trigger channel" which has sharp spikes from baseline 0V to 5V and back down to 0V. I need to crop all ...
-1
votes
1answer
57 views

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

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 $...
3
votes
1answer
569 views

Cyclic Redundancy Check of an input sequence using MATLAB

I understand how to mathematically calculate the cyclic redundancy check CRC of bits, for example if the CRC is of length 16 $$ CRC(D) = (M(D) + I (D)) D^{16} \,\,\, mod \,\,\,\ G(D)$$ where $M(D)$ ...
2
votes
3answers
172 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
1answer
395 views

Runge Kutta Method Matlab code

So I have a programming assignment with the following instructions: Consider the nth-order differential equation $$Ax^n (t) = x ^{(n-1)}(t) + x^{(n-2)}(t) + ... + x(t)$$ where $A$ is a real-...
0
votes
1answer
513 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 ...
0
votes
1answer
28 views

calculating different values of a function in MATLAB [closed]

i want to calculate different values of $h_j$ for $j = 0$ to $10$ where $\alpha = \beta = \frac {1}{2}$ and $h_j = \frac {2^{\alpha+\beta+1} \Gamma(j +\alpha+1)\Gamma(j +\beta+1)}{(2j +\alpha+\beta +...
0
votes
0answers
27 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 ...
0
votes
0answers
17 views

Help creating Matlab code for iterative method [closed]

I am new to Matlab programming. I need to use iterative methods to solve the following system of equations with Matlab: ...
2
votes
3answers
68 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)$ ...
1
vote
1answer
18 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
1answer
516 views

Matlab integral with parameter

I'm a beginner with Matlab, and I'm trying to solve the following problem. I'd like to define a function $$F(x) = \int_0^{+\infty} \frac{\sin t}{1 + xt^4} \, dt$$ and plot it on the interval $[1,3]$....
0
votes
1answer
1k 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 ...
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 ...
0
votes
1answer
400 views

How to compute the bivariate normal distribution CDF with rho in Matlab?

I want to compute the bivariate normal distribution CDF with rho in matlab, but I just find mvncdf function http://www.mathworks.com/help/stats/mvncdf.html. I do not know how to use it and how to use ...
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
8 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
18 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 ...
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) &...
0
votes
0answers
13 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
34 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
35 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 ...
2
votes
0answers
160 views

Least-squares problem with quadratic equality constraint

I want to find the solution of a Lagrange equation whose inputs are matrices. First I have the equation Ax=0. By decomposing $A$ into $A_3$ (columns 9 to 11 of A), $A_9$ (the rest of the columns), ...
1
vote
1answer
1k views

convex hull function in matlab

Is there any way to compute the convex hull of a finite set of points in Matlab and gives the half-space representation as its result? I usually use a toolbox called MPT developed at ETHZ Zurich, but ...
0
votes
2answers
1k 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
1answer
24 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....
0
votes
0answers
13 views

Matlab for the joint distribution

I calculate one joint distribution function, and hope to implement it in Matlab. The function is a little complex: $$F_X(x)=P\left(\frac{z}{1+y}\leq x\right)= \int _{0}^{\infty}F_{Z/Y}(x(1+y))P_Y(y)...
0
votes
0answers
9 views

Optimize linear function with integral as a constrain

How can I solve a linear optimization problem with an integral as a constrain? I am looking for a Matlab toolbox. My optimization problem is: $\max_{\alpha} \sum_{k=1}^K \alpha_k \cdot x $ such that ...
0
votes
1answer
92 views

What is the value of $e^{-10000}$?

What is the value of $e^{-10000}$? We know that the function $e$ does not attain value $0$ anymore. But in R and Matlab the value of $e^{-10000}$ is given as $0$ which is not correct anymore. I ...
0
votes
0answers
14 views

How to Plot Silhouette with Sørensen–Dice Similarity Coefficient

How to plot silhouette with Sørensen–Dice similarity coefficient? I already have the cluster result and distance value. clust: 1 1 2 2 2 metric: ...
0
votes
2answers
411 views

matlab cell convert to columns

I am having difficulty with MATLAB. I have 106 columns and 1 row. Each cell in each row contains a different amount of numbers. If I type result{1} I get 7. If I type result{2}, I get 3 numbers, etc......
0
votes
1answer
48 views

Algorithm for getting consecutive line segment edge points from midpoints

So I have a rectilinear grid that can be described with 2 vectors. 1 for the x-coordinates of the cell centres and one for the y-coordinates. These are just points with spacing like x spacing is 50 ...
0
votes
1answer
19 views

How would you take advantage of the knowing the zeros in T, a tridiagonal matrix, in a code for Gaussian elimination?

When $T$ is tridiagonal, its $L$ and $U$ factor have only two nonzero diagonals. How would you take advantage of the knowing the zeros in $T$, in a code for Gaussian elimination? Find $L$ and $U$. $$...
1
vote
2answers
2k views

Chi square goodness-of-fit test for Uniform distribution using Matlab

I need to test random numbers generators in 1, 2 and 3 dimensions. Criteria of test is that generated numbers are from uniform distribution. I am doing this using Matlab. I'm told to use Chi-2 test ...
3
votes
1answer
864 views

Plotting discrete time signals involving sumations in matlab.

Many of the examples I've encountered while looking for an answer are simple functions that do not involve summations. Suppose I have the following function; ...
0
votes
0answers
12 views

Did I implement a log-normal distribution incorrectly?

I have a bunch of data relating to the lengths of certain objects. I found out that the log of these lengths are somewhat normally distributed, so I used a lognormal distribution to approximate the ...
5
votes
3answers
1k views

How can I write an SDE in Matlab?

My professor would like me to solve a system similar to the following: $$ dx_i=[f_i(x_1,x_2,...x_n)]dt + g_ix_idW_i$$ Where $g_i$ are positive constants that measure the amplitude of the random ...
1
vote
3answers
33 views

Creating nearest neighbors Laplacian matrix

I want to create a general formula for an $N \times N$ nearest neighbors Laplacian matrix such that I can write an mfile in MATLAB to compute the matrix for given $N$. The nearest neighbors Laplacian ...
-1
votes
0answers
17 views

Inital condition for 1st order derivative

I have a PT2 system filter, Y'' = (a0)*Y'+(a1)*Y+(b)*u. I want to apply this filter to my signal, i have a problem in deriving ...
2
votes
0answers
62 views

How to decompose a 2d shape into sin and cosin modes?

Assume that you have a circle with radius $r_0$, then you keep adding cosine modes as below: $r=r_0+a_1\cos(1\theta)+a_2\cos(2\theta)+a_3\cos(3\theta)+a_4\cos(4\theta)+~...$ if you plot this as ...
4
votes
0answers
107 views

Two Matlab ODE solvers, two different results

I am solving a system of ODEs using Matlab. One particular set of parameters caused the solver to fail, so I worked my way through the different solvers Matlab provides. I was surprised to find that ...