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

principal component analysis plot on matlab

we have following command for analyse Iris data ...
3
votes
3answers
5k views

Understanding Fourier transform example in Matlab

I'm studying about Fourier series and transform and I get confused with the following Matlab example of Fourier transformation: ...
3
votes
2answers
667 views

Matlab code for computing index of matrix

I need help to make Matlab code for computing index of matrix. The index of matrix $A$ is the least non negative integer $k$ such that $\operatorname{rank}(A^{k+1}) = \operatorname{rank}(A^k)$. ...
0
votes
1answer
2k views

find equilibrium points in matlab

I need help with this material: The dynamics growth of two populations is expressed by the system of equations: ($x=$ prey, $y=$predator, $0 \leq t \leq 30$) $$x(1-x)-\frac{2xy}{y+x}=z$$ ...
-1
votes
1answer
149 views

Solve nonlinear equations: variables with degree six and degree eight.

Suppose I have two nonlinear equations with two variables $\ell$ and $m$; the variables $\ell$ and $m$ are of degree eight in the first equation and of degree six in the second equation. How it ...
0
votes
1answer
49 views

Sampling random numbers with a certain condition.

I want to randomly sample three variables that are conditioned by $$x_1 \le x_2 \le x_3$$ and $x_1\in [0,\, \ell]$, $x_2\in [0,\, \ell-\ell_1]$ and $x_3 \in [0, \,\ell-\ell_1-\ell_2]$. I have only ...
0
votes
1answer
48 views

Matlab integration

I have a graph. I need to integrate between certain x values. I don't have a function for the graph, the curve came from an array of x values and y values. How do I do this?
1
vote
1answer
131 views

Parameter Learning (Beta Distribution)

Coin flip experiment: We got a dataset with N = 10 observations [0,0,0,1,1,1,1,1,1,1] where 0 stands for ...
1
vote
1answer
158 views

calculating an incoherence property

With respect to Matrix Completion and Compressive Sampling (CS) I'm trying to understand how to calculate an incoherence property μ between two bases Φ and Ψ. Getting this incoherence is important ...
0
votes
1answer
957 views

How to solve linear equation using Matlab?

A= [1 2 3;3 4 5;5 6 7], B=[1;1;1]. I need to solve the equation $AX=B$. Here am using Matlab code like X=linsolve(A,B). ...
1
vote
1answer
489 views

Heuman Lambda Function in MATLAB

I'm trying to implement the Heuman Lambda function in MATLAB, but i'm having problems getting a correct answer. The Heuman Lambda Function is: $$ \Lambda_0(\beta,k) = \frac{2}{pi}[E(k)F(\beta,k') + ...
4
votes
1answer
2k views

How to compute elliptic integrals in MATLAB

I need to calculate the complete elliptic integrals of the first and second kind , the incomplete elliptic integral of the first kind, and the incomplete elliptic integral of the second kind in ...
1
vote
1answer
135 views

Free software or algorithm for Second-Order Cone Program

I need to solve the following optimization problem: $$ \mathbf{x}^\ast = \operatorname{argmin}_{\mathbf{x}} \Vert \mathbf{Rx} \Vert_2^2 \;\;\; \mathrm{s.t.} \;\;\; \mathbf{s}^\mathrm{H} \mathbf{x} = ...
0
votes
1answer
58 views

spectral structure of sinusoidal model

let us consider following code ...
1
vote
0answers
738 views

Significant improvement when I use lsqnonlin function with wrong sized X

I was trying to solve a nonlinear least-square optimization problem using matlab function lsqnonlin with default algorithm trust-region-reflective. Let the optimization problem be "minimize ...
0
votes
1answer
60 views

What is the best built-in optimizer in Matlab for this problem?

I need to optimize $$\sum_{j=1}^p\frac{\sigma^2 \alpha_j^2}{\sigma^2+\delta_j^2\alpha_j^2}-\frac{\left(\displaystyle\sum_{j=1}^p \displaystyle\frac{\sigma^2 ( \delta_j^2 \alpha^2 - ...
1
vote
0answers
53 views

Strange values of approximating coefficients returned by matlab's wavelets decomposition

I'm trying to get wavelet decomposition of arcsin(x) using, say, haar wavelets When using both Matlab's dwt or wavedec functions, I get strange values for approximating coefficients. Since applying ...
1
vote
1answer
55 views

Is there something useful for third boundary condition on Poisson equation

There is a following task for a friend of mine to make: $$-\Delta u=f,x\in(0,X),y\in(0,Y)\\-u_x+\alpha(y)u\Bigr|_{x=0}=g(y)\\u\Bigr|_{x=X}=c(y)\\u\Bigr|_{y=0}=a(x)\\u\Bigr|_{y=Y}=b(x)$$ She needs ...
0
votes
2answers
311 views

Complementary error function in matlab

Please I really want to know how to verify the following relation in MatLAB $\text{erfc}(x)\overset{x\rightarrow\infty}{\longrightarrow}\dfrac{e^{-x^2}}{x\sqrt{\pi}}$
1
vote
1answer
170 views

Shifting using fouriertransform

I'm doing a small mathematical exercise where I take a function, perform a Fourier transform on it and then multiply the result by $e^{i\alpha w}$. And then take the inverse Fourier transform of the ...
0
votes
0answers
398 views

Gauss Quadrature in 3D

I have a code for computing the elasticity equations in 2D, and am currently extending it to 3D. I am using Q1 (brick) finite elements, mapping from a [0,1] cube reference element. I am currently at ...
0
votes
0answers
54 views

2-norm of a matrix

I have come across the 2-norm of a matrix, http://www.matrixanalysis.com/Page281.pdf, this is something I found on the web. In particular, MATLAB calculates a norm of a matrix via the 2-norm, I was ...
4
votes
1answer
335 views

gradient flow programming (matlab)

Consider $$f(x,y)= x \ y \ e^{-x^2-y^2}$$ I need to find the gardient flow of f starting at the point (0,1) then (2,4). I know that this entails solving the follwing ODE $$\dot X(t)= - \nabla ...
0
votes
1answer
80 views

Understanding an affine transformation

I am trying to implement a modified version of sift tracking. I found a matlab implementation of sift to track objects in which, basically, they take the indices of the matches and compute the ...
3
votes
1answer
146 views

Solve the differential equation: $y''+(1-2x)y'+2x(e^{x^{2}}-1)y=xe^{x^{2}}$

I have an exercise of solving the equation above using MATLAB, with a hint to set $ v(x)=(y'+y)e^{-x^{2}} $. I tried to do with my hand and get the following: $ v'+2xy=x $, but I don't know what to do ...
1
vote
0answers
130 views

Solving for eigenvectors with eigenvalues

I'm not good with math. I can say I understand the big picture, but I rely on Matlab for doing everything for me. I have a specific problem: $$US = \left(\theta F + (1-\theta)F XX^\mathrm{T} ...
1
vote
1answer
238 views

What are Riemann Matrix?

I got this information regarding Riemann matrix: RIEMANN is a N-by-N matrix associated with the Riemann hypothesis, which is true if and only if: ...
1
vote
1answer
275 views

Using Romberg integration with improper integral

I'm trying to write a MATLAB function that implements Romberg's method of integration. Problem is that I'm trying to approximate:$$\int_0^1\frac{\sin{x}}{x}dx$$ but the function is not defined at $x ...
0
votes
2answers
117 views

How to write this simple matlab script to create a matrix from another matrix.

I have a matrix $A= \pmatrix{ 0 & 1/3 & 1/3 & 1/3 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 ...
0
votes
2answers
216 views

Concerning the general solutions to linear ODEs Y'=AY when A has multiple eigenvalues

Given linear ODES Y'=AY, where Y is a column vector, A is a 6*6 square matrix. Clearly A has 6 eigenvalues, namely r1, r2, r3, r4, r5, r6. Herein we assume r5=r2, r6=r3.That is, r2 and r3 are two ...
3
votes
1answer
66 views

Solve Ax = b, but I have a function that implements A

I have an overdetermined linear system $Ax = b$. I need to choose an $x$. $x$ has about 100 elements in it. If I had the matrix $A$, I would set x equal $A^\dagger b$, the pseudoinverse of $A$ ...
0
votes
2answers
96 views

Intuition behind log plotting

The two plots are the same, except the 2nd one has been log transformed on the y axis. Could I please draw your attention to what happens when Theta >0.65? After taking the log-lin plot it seems ...
0
votes
0answers
36 views

simple question on SVD

I have an algorithm that outputs a vector 'v' for every iteration. With ever iteration the change in vector v will get smaller and smaller. therefore my psuedo code should be if vold-v < 0.001 ...
-1
votes
1answer
33 views

Numbers-matlab-to which number does it correspond

I have written a code in matlab and got this result for something I calculated: 1.3000e+003 To which number does my result correspond?
1
vote
0answers
308 views

How to solve nonlinear constrained optimization in Matlab?

I have to solve a nonlinear constrained function in matlab, and I am not familiar with it's commands. the problem is: minimize $E(b,c)$ constraints: $k1< c\sqrt{b}< k2 ; c/6>k3$ Note: E(b,c) ...
0
votes
1answer
96 views

Numerical integration for integrals 7th order.

I need to calculate integral which looks like below, with some numerical method: ...
1
vote
1answer
108 views

Why elapsed time is an exponential function of the number of elements in a vector that is sorted (MATLAB)

In the following script (that performs "bubble sort" on an row vector) it seems that the time elapsed when matlab executes the sorting depends exponentially on the number of elements in the vector. ...
0
votes
2answers
807 views

finite difference method for nonlinear ode

I am trying to use finite difference method to solve $y'''+y^2y''-y'=0, y(0)=y'(0)=0, y''(1)=1$. I let $u=dy/dx$ so the new problem is $u''+y^2u'-u=0, u(0)=0, u'(1)=1,y=\int u$. To try and solve this ...
1
vote
1answer
271 views

How to find null space of a matrix over $\mathbb{GF}(2)$?

How to find null space of a matrix over $\mathbb{GF}(2)$ ? Are there any algorithms available? I am not sure here is appropriate to ask this or not: Is there any routines for MATLAB or Maple?
1
vote
1answer
58 views

I cant find the solution of these 2 equations with matlab

$2(x)^2 + (x - y)^3 - 2= 0$ $y - (x - y)^3 + 10 = 0$ I tried to solve these equations by using matlab fsolve command. Then matlab found no solution. Can someone solve please?
2
votes
2answers
820 views

Solving (Frenet-Serret) differential equation system in Matlab

I'm about (trying) to solve the Frenet-Serret equation given by the known formulas, finding $e(s)$, $n(s)$, $b(s)$, where $e'(s) = \kappa(s)v(s)n(s)$ $n'(s) = -\kappa(s)v(s)e(s) + \tau(s)v(s)b(s)$ ...
0
votes
0answers
426 views

MATLAB Point Spread Function

Is anyone familiar with MATLAB point spread function? I have an image. From there I found five objects and I want to do a PSF on each of them such that I get a 3D color graph to show how bright the ...
0
votes
1answer
105 views

Writing a script for finding the largest and second largest eigenvectors of a symmetric matrix.

For a final project in my linear algebra intro, I have been tasked with writing a script that finds the largest and the second largest eigenvectors of a symmetric matrix in Matlab. For the best ...
0
votes
2answers
20 views

Proportionality between linear segments

This may seem a rather elementary question, but I was wondering if there is a way of, having two linear segments $y_1$ and $y_2$ in accordance to $y=mx+b$ and with different values for $b_1$ and ...
1
vote
1answer
150 views

Is implementation of method possible?

Can I implement the Jacobi and Gauss-Seidel method,at a matrix, even if its determinant equals to zero? I use Matlab and want to find the convergence of the method for the Hilbert matrix. I wanted to ...
0
votes
2answers
111 views

Calculating the norm of a matrix in matlab

So I've been given the matrix A A = [1 2; 3 1] and the question is: If v is an error vector with ||v|| = 0.01, give an upper bound on ||A^30v||. ||A^30v|| = ||A^30|| * ||v||, correct? I used the ...
2
votes
0answers
237 views

Runge-Kutta method accuracy

I got Runge-Kutta method here and I solve this system using it. So here's Runge-Kutta stuff $k_1 = f(t_n, y_n)$ $k_2 = f(t_n + h/2, y_n + hk_1/2) $ $k_3 = f(t_n+h, y_n - hk_1 + 2hk_2)$ $y_{n+1} ...
3
votes
2answers
80 views

Generating points from a standard Gaussian

I'm new to Gaussian distributions and I'm trying to generate say, $ N$ points from a $ M$ dimensional standard gaussian. What does this mean? How would I do this in matlab?
1
vote
0answers
153 views

Whitening matrix for Fast ICA

I have a matrix $X $ with dimension say $ m \times n $ with $ m> n $. I am trying to whiten this matrix in matlab by first taking the $C= \operatorname{covariance}(X)$ followed by eigenvalue ...
1
vote
1answer
3k views

Using trapz and linspace to evaluate an integral in Matlab

I have two functions f(x) and g(x), and I need to find a numerical approximation to the area bounded by the two curves. How do I do this using the trapz and ...