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

Help with Hermitian Symmetry and its inverse Fourier transform in MATLAB.

I have tried to impose Hermitian symmetry on the complex number $z$ which is varies with $x$. I need to take its inverse Fourier transform. A hermitian symmetry should give a real valued inverse FT. ...
2
votes
1answer
192 views

Using FFT in matlab

I am not completely sure if this is where a MatLab question belongs, so if not, please direct me where I should ask. But onto my question. I am working on trying to deconvolution a signal with ...
0
votes
1answer
1k views

Projection matrix onto null space

I have a matrix H and I want to find the projection matrix onto null space. How can I do this? Sorry if my question seems naive. Thank you, Tanja
2
votes
0answers
106 views

Intersection of orthonormal basis of two subspaces

I want to ask how can I form a subspace which is an intersection of the orthonormal basis of two another subspaces and find its dimension in Matlab? Thank you in advance, Maya
3
votes
0answers
273 views

Symbolic summation MATLAB

Can someone help me generate the following symbolic summation in MATLAB? I then want to differentiate the Jacobian matrix. $f(x) = \sum_{i=1}^{n} \sum_{j=1}^n (x_i (\Sigma x)_i - x_j (\Sigma ...
0
votes
0answers
33 views

what the best software to plot points in 3D space [duplicate]

I have 4 points in the Eculidean space, $p_{0}=(0,0,1000)$ , $p_{1}=(0,0,0)$ , $p_{2}=(1000,1000,0)$ and $c=(231,231,412)$ I want to mark these points in the 3D space and connect the points $p_{0}c$, ...
1
vote
0answers
87 views

Bilinearly Blended Coons Patch

I have four quintic Bézier curves and I want to create the Coons Surface that interpolates them. How can I obtain the 25 control points of the surface? Thanks.
0
votes
0answers
34 views

Vicinity of point in a phenomenon

I have a phenomenon in matlab that is based on: $y\,z(\Delta u/\Delta x)(x,y,z)-(x+z)(\Delta u/\Delta y)(x,y,z)+x\,y(\Delta u/\Delta z)(x,y,z)=0;\; (x,y,z) \in \mathbb R^3$. I have $M\in\mathbb R$ ...
0
votes
1answer
2k views

Finding matrix inverse by Gaussian Elimination With Partial Pivoting

Hello guys I am writing program to compute determinant(this part i already did) and Inverse matrix with GEPP. Here problem arises since i have completely no idea how to inverse Matrix using GEPP, i ...
-1
votes
2answers
150 views

How to remove high frequncies having fft?

What are the units of measure of FFT elements? Can I just set higher elements to zero to filter out higher frequencies? It looks like no. ...
2
votes
2answers
214 views

How to notate or write recurring decimals in Matlab?

I'm new on Matlab, and I have a question. Can I represent recurring decimals? For example I want to operate 216.6666666… by another number. I'll appreciate your answers.
0
votes
2answers
43 views

Converting an integer to a vector of 0's and single 1

I have an array of labels in the form: [1;3;2;] I wish to convert this to an array of vectors, where only the i'th element is 1, and the rest are 0's. So the above would be (assuming 5 lables): [1 0 0 ...
1
vote
1answer
78 views

Nonlinear regression analysis of a vector

I'm trying to get a nonlinear fit of a vector in Matlab with no success. Let's assume that I have a vector called data: data = [1,30,250,55,22,76] which can be ...
1
vote
1answer
1k views

How to solve transcendental equations with MATLAB?

Here's the equation: $$ - \frac{MN}{\sqrt{2\pi \left( \sigma_1^2 + \sigma_2^2 \right)}} \frac d {dy} \exp \left( -\frac {y^2} {\left( \sigma_1^2 + \sigma_2^2 \right)} \right) = k \left( x-y \right) ...
3
votes
2answers
328 views

Incomplete beta function in MATLAB

Mathematica is capable of evaluating the incomplete beta function $$ \mathrm{Beta}[z,a,b] = \int_0^z u^{a-1}\left(1-u\right)^{b-1}\,du $$ even when the argument $z$ is negative. MATLAB's function ...
0
votes
1answer
86 views

Matrix manipulation with matlab.

Is there a way for a given matrix: $k= \left( \begin{array}{cccccc} a_1 & b_1 & c_1 & d_1 & e_1 & f_1\\ a_2 & b_2 & c_2 & d_2 & e_2 & f_2\\ a_3 & b_3 & ...
1
vote
2answers
304 views

How to find the 'centre' of vectors in 3-dimensional space.

How do I find the 'centre' of a set of vectors in $ℝ^3$? By centre I mean I want to find a vector such that maximum angle between it and any other vector in the set is kept to a minimum. Another way ...
1
vote
1answer
585 views

Solving Laplace's equation using finite differences

I having coding in MatLab to approximate solutions to Laplace's equation in 2D using finite differences. I was able to do it without much problem. I learnt about how to implement this using this: ...
1
vote
0answers
112 views

Using MATLAB to do spectral analysis for a periodic signal

As is said, I was asked to do spectral analysis for a periodic signal, i.e. plot the magnitude of its Fourier transform against frequencies. I know that for periodic signals, the spectral is just ...
0
votes
1answer
79 views

Maximization of minimum difference

Suppose we have a function of the form: $(x_1 - x_2) + (x_3 - x_4) + (x_5 - x_6)$ and we have maximized this summation using linprog (using some constraints which are not important for this matter). ...
0
votes
3answers
192 views

Numerical solution of system of PDEs (1 order,linear,homogenious) method Lax-Wendroff

I'm trying to solve linear system of PDEs $$\frac{\partial \bar{u}}{\partial t}+\begin{pmatrix} \frac{2}{5} & -\frac{72}{5} & \frac{64}{5} \\ \frac{6}{5} & \frac{-56}{5} & ...
1
vote
0answers
698 views

eigenvector centrality for directed graphs

I need to compute eigenvector centrality for a directed graph: It's a network of international trade of goods, so obviously what country A imports from B (= B exports in A) is not what country B ...
3
votes
2answers
1k views

MATLAB code to find distance and eccentricity in graphs

I was trying to find the distances between vertices in graphs. But as the number of vertices are increasing up to 25 vertices or more, its becoming a tedious job for me to calculate $distance$ and ...
0
votes
1answer
87 views

Signal approximation using linear combination of functions

How I can approximate the signal $x(t)=0.001\,t^3 \exp(-0.1t)$ in the interval $[0,100]$ using a linear combination of the following functions: $f_1(t)=A_1$ $f_2(t)=A_2\cos(0.05t)$ ...
1
vote
0answers
106 views

Produce a 4:2:2 sub sampled Y matrix, Cr matrix, Cb matrix for an image

I have write the matlab code below for to extract Y, Cb, Cr information from the picture: ...
1
vote
1answer
192 views

Generate samples of sinusoid in matlab

I have to generate 100 samples of sinusoid in matlab with frequency 0.2Hz and sampling rate 2Hz. Until now i have pass into matlab the values: ...
1
vote
1answer
47 views

point on triangle

let we have a domain, for example square that partitioned by some triangles that are not necessarily similar, and we know the coordinates of all vertices and the maximum size of the sides of all ...
0
votes
0answers
396 views

Lagrange Interpolation Polynomial Code for coefficients

Can someone help me with developing a simple MATLAB code that inputs the n datasets $ \lbrace x_i : i=0,...,n \rbrace$ and $ \lbrace f^i : i=0,...,n \rbrace$ and produces the coefficients $ \lbrace ...
3
votes
0answers
100 views

Is there a way to configure MATLAB's plotchar function to other sizes?

plotchar plots a 35 element vector as a 5x7 grid. Is there a way to plot other grid sizes characteres?
0
votes
2answers
4k views

MATLAB Plot vertical line

I have a system of equations, about 3 equations, that I need to plot that are dependent on 2 variables, R and z. But one of the equations is R={constant value}. ...
0
votes
1answer
171 views

What does it mean [X,T]=MATRIX?

I'm starting to study this example but I'm not understanding the matrix operation on matlab: Whe it does [X,T] = prprob; it will copy the predefined 26x35 matrix ...
0
votes
2answers
140 views

Logistic Equation: Equilibrium

Given a differential equation, for example, a logistic curve, how do I determine the equilibrium points, graphically? Consider $$x'=ax\left(1-\frac{x}{b}\right)-\frac{x^2}{1+x^2}$$ It is clear that ...
8
votes
3answers
317 views

is there a name for this function (parity of a finite sequence)?

Variants of this question have been crossposted to Stack Overflow and Computational Science Stack Exchange. Additional answers may be found at these other sites. Math people: In an attempt to ...
2
votes
1answer
142 views

Matlab, integral over arbitrary body (something looking like a potato)

I'm supposed to calculate the inertia tensor of an asteroid defined by a bunch of vertices in matlab, assuming constant density. The specifics of the integral are not important, it all boils down to ...
2
votes
0answers
171 views

MATLAB eig(A,B) of a positive semi-definite matrix pair (A,B) gives complex eigenvalues

A and B both are 151 by 151 psd matrices, I want to solve the generalized eigenvalue proplem A * v = Lambda * B * v when using MATLAB function eig() [V,D] = eig(A,B) I get complex numbers in both ...
2
votes
0answers
170 views

Iterative solver for the pseudo inverse

I have got the following equation: $\begin{bmatrix} \hat{c}\\ \hat{\lambda} \end{bmatrix}=\begin{bmatrix} B^T \cdot B & H^T\\ H & 0 \end{bmatrix}^+\begin{bmatrix} B^T \cdot Y\\ 0 ...
1
vote
1answer
55 views

MATLAB Vector Assignment of Arbitrary Length

Greetings: let's suppose I have a loop that will execute 20 times, and within that loop I'll obtain a vector of information whose length will increase, each iteration, from 2 to 20. Now suppose I have ...
0
votes
1answer
84 views

Rounding numbers in MATLAB

I am making a function for finding the approximate value of the second derivative (using the forward difference formula) of $sin(x)$ in $x=\frac {\pi}{3}$ with step $h=10^{-n}$ for $n=1, 2, 3, 4, 5$ ...
1
vote
1answer
1k views

Is there any matlab code to find out maximum eigenvalue of the randomly generated matrices?

I am running a matlab code for computing the Drazin inverse of the matrix $A$. Initial value of the iteration method is $X_0 = \beta A^{k}$, where $k = index (A)$(For $A\in \mathbb{C}^{n\times n}$, ...
0
votes
1answer
286 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, ...
1
vote
1answer
409 views

How to plot multinomial beta from Dirichlet Distribution

I would like to plot the multinomial beta from the Dirichlet Distribution wiki page. $$\mathrm{B}(\alpha) = \frac{\prod_{i=1}^K \Gamma(\alpha_i)}{\Gamma\bigl(\sum_{i=1}^K ...
0
votes
1answer
157 views

Alternative code for solving pendulum equation $\ddot{\theta} + \sin{\theta} = 0$

One MATLAB code for solving pendulum equation $\ddot{\theta} + \sin{\theta} = 0$ is: T=100; h=0.1; n=floor(T/h); y0 = [1 0]; y=y0; sol=y0; for nT = 1:2 theta = y(1); y(1) = y(1) + h*y(2); ...
0
votes
1answer
103 views

Sound waves under water, matlab

c(z) = 4800+p1+p2*(z/1000)+p3*e^((-p4*z)/(1000)) p1 = 0.0070 p2 = 0.0378 p3 = 0.0016 p4 = 1 Tabel values z = [0 500 1000 1500 2000 2500 3000 3500 4000 5000 6000 7000 8000 9000 10000 11000 12000] ...
2
votes
2answers
112 views

Matlab plot3 see-through element

I am plotting the following Stewart platform in Matlab using plot3 and fill3. The green line that I have marked in the red ...
5
votes
1answer
75 views

Generating $n\times n$ random matrix with rank $n/2$ using matlab

Can we generate $n \times n$ random matrix having any desired rank? I have to generate a $n\times n$ random matrix having rank $n/2$. Thanks for your time and help.
2
votes
2answers
676 views

Lagrange polynomial and derivative problem

I need to code this function in matlab $$L'(x) = \sum_{k = 0}^{n} f_k l_k(x) $$ Where's $l_k$ looks like this $$l_k(x) = \sum^{n}_{j=0, j \neq k} \frac{\prod^{n}_{i=0}(x - x_i)}{(x - ...
8
votes
4answers
7k views

Matlab code for generating random symmetric positive definite matrix

Could anybody tell me How to generate random symmetric positive definite matrix using Matlab? Thank you very much for the help and suggestions.
1
vote
1answer
4k views

Write a function in MATLAB that returns the value of a function f (where f needs to be written by the user)

Newton's method for 2x2 case: $$J(x_n)s_n= f(x_n)$$ then update $$x_{n+1} = x_n - s_n$$ where $J$ is the Jacobian matrix formed from $f$. And $x_n$ is a 2-D vector. Write a MATLAB function to ...
1
vote
2answers
9k views

Finding points along a plot in Matlab

I have the following plot and a file of the data which creates that plot. I would like to have Matlab find the following points for me: [y,x] for peak noted by the 100% line [x] for where the plot ...
0
votes
1answer
167 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 ...