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

Pseudorandom number on matlab

I was looking for the exact dynamic that Matlab uses for pseudorandom numbers. The only thing that I find is a generic form for the Matlab pseudorandom number generator which starts with a seed $x_0$ ...
0
votes
1answer
33 views

Drawing 3D stomach structure in Matlab [on hold]

I would like to plot a 3D structure representing the stomach in Matlab. A sketch of what it should look like is here: http://thoracicsurgery.stanford.edu/patient_care/images/normal-stomach.jpg Still, ...
1
vote
1answer
33 views

differential equation into state space

I have this dynamic system $$ J \ddot{\theta} + F\dot{\theta} = u $$ I would like to acquire the state space of the system. This is what I've done $$ x_{1} = \theta, \\ x_{2} = \dot{\theta}, \\ ...
0
votes
0answers
9 views

How do I get around finding a digital filter which is a narrow bandpass with a small group delay?

I need to find a digital filter that meets the following criterion: Is a narrow bandpass (1/40 of normalized frequency width) As small as possible group delay (preferably less than 300 samples) ...
0
votes
0answers
20 views

pFourier Transform using symbolic toolbox

Hi i need to use the symbolic toolbox from matlab and solve the following by fourier transform: $\int^{\infty}_{-\infty}\frac{\sin(at)\sin(bt)}{t^2}dt\text{ }\text{}\text{}$ So far the algo i came ...
0
votes
0answers
31 views

traingular matrix

I am not much in to the matrices. so I am sorry if I can not put forward the question properly. Assume $G_{n\times n}$ is a rank $n$ matrix (Indeed $G$ is the generator matrix of a lattice). I need ...
0
votes
0answers
21 views

extrapolate boundary data of a 2d function

I have a function defined over a 2d domain. I want to keep all the internal data, but the information near the boundaries are less accurate and I want to extrapolate them from the inner points. Is ...
4
votes
0answers
44 views

How to solve this equation (may be with least squares)?

I have a system of linear equations in the following form. How can I solve it? $$\operatorname*{argmin}_{a,b} \sum_{i,j} \left( \left| X(i,j)-aY(i,j)\right|-b \right)^2$$ Where $X$ and $Y$ are ...
0
votes
1answer
25 views

How to find parameters that minimize the sum of squares, using Matlab?

I have a system of linear equations in the following form. How can I solve it in Matlab? $$\operatorname*{argmin}_{a,b} \sum_{i,j} [X(i,j)-a\times Y(i,j)-b]^2$$ Where X and Y are known. I need to ...
1
vote
1answer
22 views

infinitisimal part and the directional integral

In the paper A circle detection approach based on Radon Transform by Erman Okman and Gozde B. Akar. I have a few questions on some basics. first of all what does $$ds^2 = dx^2 + dy^2$$ ...
0
votes
0answers
12 views

matlab: cdfplot for relative error

The figure shown above is the plot of cumulative distribution function (cdf) plot for relative error (attached together the code used to generate the plot). The relative error is defined as ...
2
votes
0answers
15 views

using ode45 for descriptive forms

Using Matlab what would be the most efficient way to solve, $A_1x'(t) = A_2x(t)$, where both $A_1$ and $A_2$ are $n\times n$ matrices. Both are sparse matrices and hence I want to avoid inversion. ...
2
votes
3answers
63 views

Integration of a real powered rational expression

Peace be upon you, I've encountered this pretty integral \begin{align*} \int_0^1&\frac{x^{\alpha+\beta-1}-x^{\alpha-1}}{x-1}dx,\\ \\ &\alpha,\beta\in\Re^+ \end{align*} It seems much simpler ...
0
votes
0answers
23 views

Integration of nonlinear and linear ODEs

\begin{equation} \frac{dc_1}{d\tau}= \alpha I(1-c_{0}) + c_{1} (-K_{F} - K_{D}-K_{N} s_{0}-K_{P}(1-q_{0}))+ c_{0}(-K_{N} s_{1}+K_{P}q_{1}), \nonumber \end{equation} \begin{equation} ...
0
votes
0answers
8 views

Showing Covariance in a 3D graph

I have a 3D scatter plot and I want to visually show COVARIANCE on it. One can show COVARIANCE, for example with an ISO LINE. With this method, one generally gets an ellipse aligned with the shape of ...
1
vote
1answer
90 views

find a matrix transform

Given a vector $v={(v_1,v_2,...,v_n)}^T$, I would like to find some matrix operations on $v$ to create an $n \times n$ matrix $X$ such that its entry $X_{i,j} $ satisfy (1), (2), (3), (4), ...
1
vote
1answer
45 views

Differentiation of the Beta function

I suppose that \begin{align*} \frac{\partial}{\partial x}\left[B\left(x,y\right)\right]=&\frac{\partial}{\partial x}\left[\int_0^1t^{x-1}(1-t)^{y-1}dt\right]\\ ...
0
votes
0answers
23 views

Implementing formula correctly in matlab for neuroscience: total soma membrane potential?

Please help me to understand: am I correctly implementing a total soma membrane potential (TSMP) equation in Matlab? Due to being a new member I need to use this list link to refer to the links ...
1
vote
0answers
30 views

Plotting a set in MATLAB

I am trying to plot sets like $$\left\{x \in \mathbb R ^3 : x_1,x_2,x_3 \geq 0, x_i \leq x_j + x_k \mbox{for all combinations of }i,j,k \in \{1,2,3\} \right\}$$ with MATLAB to include the figures in a ...
0
votes
0answers
44 views

Water swallowing in Matlab

I want to simulate some water passing through a vertical cylinder in Matlab, and I would like to implement a 3d animation of it. I built the cylinder using the patch function, but I do not know how to ...
0
votes
1answer
62 views

how to get the answer for the following integration?

$ti(t)$ is a function of time which is normally given with (time,value) pairs and not defined mathematically. i need to get the value $td(t)$ by solving the following integration: ...
1
vote
1answer
29 views

Integration of a matrix by MATLAB

How do I integrate a matrix in MATLAB: A=[1,2;3,4]; B=[2*t;t^2]; i.e, how to compute: integral{expm(A*s)*B(s)}ds between ...
0
votes
0answers
6 views

SPSA loss function

I need a simple implementation (in Matlab) of the most basic SPSA algorithm for a friend of mine. I have found this code from J.C. Spall but I don't know where to find an implementation of an ...
1
vote
3answers
60 views

If $A,B$ are invertible so $AB$ is invertible

I thought about the following proofs but I am not sure about them there is $C,D$ so that $AC=CA=I$ and $BD=DB=I \rightarrow CABD=I \rightarrow$ due to associativity roles is no matrix $E$ so that ...
1
vote
1answer
59 views

Find an expression of the direction field

I have a directions vector field which I got empirically using quiver in Matlab. I want to find some analytical expressions that might work at least in part of the direction field. How can I ...
1
vote
1answer
23 views

Inverse problem with 4D and 2D matrix

I was trying to solve an inverse problem in mechanics and computing it in Matlab, when i found something unknown for me, and so I haven't any idea on how to compute it. Basically, after ...
1
vote
0answers
33 views

directed simple graph, all paths from node $ v_0 $ to an other node $ v $, MATLAB

consider a directed simple graph $ G=(V,E) $ with $ V=\lbrace v_0,v_1,\ldots,v_k \rbrace $ and adjacency matrix $ A=(a_{ij}) $, where $ a_{ij}=1 $ means, that there is an arc from node $ v_i $ to node ...
0
votes
0answers
35 views

compute a certain maximum in MATLAB

let $ C \in \mathbb{N} $ and $ c_1>c_2>\ldots>c_k \in \mathbb{N} $ with $ C>c_1 $ and $ c=(c_1,c_2,\ldots,c_k)^\top \in \mathbb{N}^k $, where $ \mathbb{N} $ are the natural numbers without ...
1
vote
1answer
28 views

Automatic defining global variables in MATLAB

How could I define a set of variables automatically in MATLAB. For example: kt1 to kt_n*(2*n+1) ...
1
vote
2answers
41 views

L1 regularized SVM in Matlab

Minimizing the following SVM formulation \begin{align} \arg\min_{\mathbf{w}}\frac{1}{2}\|\mathbf{w}\|^2_2 \\ \text{subject to } \quad y_i(\mathbf{w}\cdot\mathbf{x_i}) \ge 1 \end{align} can be done ...
0
votes
0answers
27 views

Matlab code for higher order scheme

Can somebody help me how to generate the code for the increment $\Delta$Z in the document I have attached? I know how to generate the rest of the increments but struggling in how to generate ...
0
votes
0answers
39 views

Is it possible to get two different fits, both using a single term Gaussian model?

I am using Matlab to fit Gaussian/normal distributions to image intensities that are binned by 25. I recently used the "hisfit" function and then used cftool > Gaussian > single term (equation is ...
0
votes
3answers
27 views

Generating a Triangular Matrix via a Vector MATLAB

How do I generate an arbitrary (size n) triangular matrix with a vector? For example: A=[1;2;3;4;5;6;7;8;9;10]; And the answer should be: B=[1,2,3,4; 0,5,6,7; 0,0,8,9; 0,0,0,10] or ...
-1
votes
1answer
26 views

Syntax of Upper Incomplete Gamma Function in MATLAB [closed]

How is the Upper Incomplete Gamma Function implemented in MATLAB? I am confused about the syntax and it is not properly explained in MATLAB documents. If the limit is from x to $\infty$ , and i have ...
2
votes
1answer
33 views

Strange matrix multiplication behavior in Matlab

I noticed strange behavior of some calculations in Matlab. Matlab code listing: ...
2
votes
1answer
38 views

Are “constrained linear least squares” and “quadratic programming” the same thing?

A Quadratic Programming problem is to minimize: $f(\mathbf{x}) = \tfrac{1}{2} \mathbf{x}^T Q\mathbf{x} + \mathbf{c}^T \mathbf{x}$ subject to $A\mathbf{x} \leq \mathbf b$; $C\mathbf{x} = \mathbf d$; ...
0
votes
1answer
22 views

Top and bottom power spectral density of a height profile

Imagine I have a simple 1D height profile which is NOT symmetric. Now, what is truly important for me is to know what are the frequency content of the top profile (i.e. a cut profile above the ...
1
vote
1answer
44 views

Matlab, how to know time step size in the plot or how can I get the output of time step size?

Since I am using matlab ode23s solver, it contains two matlab files. One contains the differential equations and another contains plotting and to run the m-files. The code are working perfectly. Now I ...
0
votes
3answers
23 views

How to define a piecewise function in matlab?

I want to calculate the convolution sum of the continuous unit pulse with itself, but I don't know how I can define this function $$ \delta(t) = \begin{cases} 1, 0 \le t \lt 1 \\ 0, otherwise ...
0
votes
0answers
25 views

Substitution in Matlab (Iteration Process)

I am facing some problem in iterating my equations. Basically, here how it should work. A(i)= x1*B(i) + x2*B(i-1) B(i)= x3*A(i) + x4*A(i-2) A(i)= x5*B(i-1) + x6*A(i-2) B(i)= x7*B(i-1) + x8*A(i-2) ...
1
vote
1answer
31 views

Relative error when computing derivatives via FFT

I want to compute a discrete derivative via the FFT. This amounts to multiplication by the wave number in Fourier space, as detailed in the stack exchange answer here. When I increase the ...
0
votes
1answer
13 views

Iterating substitution question (Matlab)

I have four relations between A and B as below. A(i)= B(i) + B(i-1) B(i)= A(i) + A(i-2) A(i)= B(i-1) + A(i-2) B(i)= B(i-1) + A(i-2) Assume i is 7 and A(7),A(0),B(7),B(0) are known. (Just for ...
-1
votes
0answers
19 views

Matlab: solve system of equations using substitution

Suppose I want to solve a system of equations $F(x)$ which is shown as below: $x_1^3+1=0$ $x_1+x_2=0$ I want to substitute $x$ by $x_1=2y_1, x_2=3y_2$. Then the original system is transformed to ...
2
votes
4answers
113 views

$(-1)^{0.2}=0.8090 + 0.5878i$ how can this be?

I'm working on a numerical analysis project (working with matlab a lot) and I noticed that when I ask for matlab to compute the exponent of a negative number, it gives wrong output when the exponent ...
0
votes
1answer
31 views

Surface fitting

I do not need a complete answer but just some advice. I have a sparse matrix of points in a volume. I know a surface passing by these points exists and this surface is mostly flat and relatively ...
0
votes
0answers
38 views

Matrix inverses on matlab: are pinv and ./ related?

I faced with two actual implementations of the same problem, and need some help to find which one is correct. Let K be an non-square $m \times n$ matrix (a product of two eigenvalues vectors), B an ...
2
votes
0answers
23 views

writing a simple matrix [closed]

question given A as a matrix of dimension m x n, write a simple script unit with the assumption that there exist a new matrix B(with dimension n x m). produce a new matrix called C as a prod of A ...
0
votes
0answers
28 views

Error in Matlab code, help please

I have a Unitary matrix MM1 and a theta function , I am trying to create another analytic function f by by summing up the products MM1(i, j)*thet(j) i.e say when j =1 f(1) = (MM1(1,d)*thet(0)) + ...
0
votes
0answers
43 views

The phase portrait of a second order of nonlinear system using matlab

I have the following system $$ \ddot{x} + 0.6\dot{x} + 3x + x^{2} = 0 $$ In the book I'm reading, the phase portrait of the nonlinear system for the aforementioned equation is I would like to ...
0
votes
0answers
17 views

Get a set of points from Fourier plot on Matlab?

I have a program that collects raw data and also does a Fourier transform to get complex numbers. When I feed the raw data into Matlab to do its own FFT, I can get a nice plot of power on frequency. ...