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
1answer
31 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
924 views

How I can get coefficients matrix in MATLAB from the set of linear equations?

I am working in MATLAB and having problem in extraction of coefficients out of my set of symbolic linear equations. Equations are as such R = [0.8978*c - 0.8047*b - 0.020299*a, 0.8978*d - ...
4
votes
1answer
2k views

Visualizing elemental rotations using Euler angles in Matlab

I'd like to visualize elemental rotations using Z-Y-X convention in Matlab. If you'd like to follow me exactly, I'll be refering to a paper Quadrotor Dynamics and Control by Randal Beard. The base ...
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
2answers
200 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}}$
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 ...
2
votes
2answers
193 views

Finding D matrix in LDU in matlab

I have been searching the web for nearly 3 hours about a MatLab function that can take matrix A and give me back L, D, and U. ...
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 ...
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} ...
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), ...
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 ...
0
votes
1answer
134 views

Matlab od45 question

I am learning to use Matlab's ode45 to solve this equation and plot its time history: $$I_gd\omega/dt + \omega \times (I_g\omega) = 0$$ It was suggested that I ...
0
votes
1answer
301 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
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 ...
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
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 ...
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
1answer
223 views

Determining the direct and transverse tangent lines for two non-overlapping ellipses

I am trying to determine the direct and transverse lines for two non-overlapping ellipses. I specifically mean that the two ellipses are totally separated from each other with no shared regions. I ...
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 ...
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
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 ...
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 ...
0
votes
1answer
30 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 ...
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 ...
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
2answers
1k views

How to plot a phase portrait for this system of differential equations?

I beg your help.. I'd like the phase portrait for this system. I don't know how to use Mathematica/Matlab ... :( If anyone can make this portrait and post a print screen here, I would thank you ...
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
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
vote
1answer
571 views

Solving double integral numerically in matlab

In the paper "The fractional Laplacian operator on bounded domains as a special case of the nonlocal diffusion operator". Where the author has solved a fractional laplacian equation on bounded domain ...
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 ...
3
votes
7answers
194 views

Best Math Plotting Software for Electrical Engineering

I am an electrical engineering undergrad. I would like to learn a math plotting software which would be helpful in visualizing topics in advanced calculus (my immediate need). It would also be helpful ...
2
votes
1answer
1k views

Solve a second order DEQ using Euler's method in MATLAB

I need to solve the equation below with Euler's method: $$y''+ \pi ye^{x/3}(2y' \sin(\pi x)+\pi y\cos (\pi x)) = \frac{y}{9}$$ for the initial conditions $y(0)=1$, $y'(0)=-1/3$ So I know I ...
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 ...
-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: ...
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 ...
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$; ...