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

2
votes
1answer
152 views

Vectors Angles from $[0,2\pi]$

Given two vectors $V_1 = (x_1, y_1)$ and $V_2 = (x_2, y_2)$. How to calculate the angles between them in the range of $[0, 2\pi]$? I know the $\cos\theta$ similarity equation could present a $\theta$ ...
0
votes
1answer
237 views

Double dot product of two tensors [duplicate]

I have a problem that makes me very confused... I have two tensors that must be multiply. A is second order tensor and B is fourth order tensor. I know when multiplying two tensor with double dot ...
0
votes
1answer
279 views

Maximum Vertex Cover

Given a graph G=(V,E) and a positive weight function w on all the vertices, find a subset C from V such that all the edges (u,v) in E, at least one , u or v is contained in C and sum of all the ...
0
votes
1answer
844 views

Tensor double dot product

I have two tensors that i must calculate double dot product. matrix A is rank 2 and matrix B is rank 4. I want to multiply them with Matlab and I know in Matlab it becomes: A : B = trace (A*B) but it ...
0
votes
1answer
120 views

matlab equal does not work

How to judge whether two whatever is equal? alphat and alpha are two kind big vectors. Why it turns 0, which means they are not equal?
1
vote
1answer
209 views

Logarithmic scale in MuPAD

I had to plot a function, $e_n=\ln(n!)-n\ln(n)+n$, relative to a logarithmic scale. In MATLAB, I could do it simply by using semilogx but in MuPAD I can't find such ...
0
votes
0answers
32 views

STINT Approximate stochastic integrals

This is a matlab code to simulate stochastic integrals: ...
0
votes
2answers
2k views

command randn(1,N) in matlab

This program is in Matlab to simulate Brownian motion Generating GBM: ...
1
vote
4answers
370 views

Plotting in maple/MATLAB

How do you plot the following parametric equation (equation of an ellipse) in the same graph $$ x = a\cos{t} $$ $$ y = b\sin{t} $$ with varying value of $a$ and $b$ in either maple or MATLAB ? ...
1
vote
0answers
148 views

Convolution property in terms of fft (matlab)

I am working on some signal processing and I have the following data: ...
1
vote
2answers
3k views

Singularity in matrix when inverting in Matlab

As data I get a matrix A but in my algorithm I need to work on its inverse. What I do is: C = inv(A) + B; Then in another line I update A. In the next cycles I ...
0
votes
1answer
1k views

Graph Probability Density Function in Matlab

I am having a lot of trouble trying to graph this function in matlab and trying to get it to look like it should. I need to generate 200 random samples of a uniform random variable X on the range ...
1
vote
0answers
212 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
108 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
276 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
88 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
35 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
154 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
216 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
335 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
88 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
314 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
600 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
80 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
719 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
110 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
201 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
398 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
172 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
320 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
144 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
173 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
173 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
89 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$ ...