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
229 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 ...
6
votes
0answers
86 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
75 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
63 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$$ ...
2
votes
0answers
58 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
91 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
25 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
98 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
104 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
125 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
48 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
1answer
72 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
58 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
89 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
80 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
90 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
148 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
157 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
41 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
76 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
431 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
71 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
103 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 ...
2
votes
1answer
66 views

Strange matrix multiplication behavior in Matlab

I noticed strange behavior of some calculations in Matlab. Matlab code listing: ...
3
votes
1answer
1k 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
65 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
775 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
6k 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 ...
1
vote
1answer
114 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
23 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 ...
2
votes
4answers
125 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
323 views

How to compute the bivariate normal distribution CDF with rho in Matlab?

I want to compute the bivariate normal distribution CDF with rho in matlab, but I just find mvncdf function http://www.mathworks.com/help/stats/mvncdf.html. I do not know how to use it and how to use ...
1
vote
1answer
782 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
287 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 ...
1
vote
0answers
2k 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
1answer
101 views

symbolic definite integral using matlab

I have this function $$ \frac{di}{dt} = - \frac{R}{L} i $$ I know the solution which is $$ i(t) = i_{0} e^{- \frac{R}{L} (t-t_{0})} $$ I would like to get the same solution by using Matlab. How can ...
1
vote
0answers
153 views

implicit non-linear equations with complex variables

I am trying to understand a methodology for solving implicit non-linear equations with complex variables. I would like to solve for z1 below where z2 is known. Also both z1 and z2 are complex ...
0
votes
1answer
53 views

Inequality involving fractions and several variables

Based on my previous two questions (that failed), I am trying once more. What are some simplified conditions for which: ...
1
vote
0answers
64 views

Time needed to algebraically solve system of $15$ nonlinear equations with parameters

How long can I expect it will take to algebraically solve a system of $15$ nonlinear equations (without any numbers, only parameters), if I feed it into a computing software? I'm asking for symbolic ...
-1
votes
1answer
79 views

correlation matching audio files peak position

if i cross correlate an audio file with itself (which means there is no delay or difference), the peak position should be a zero or at the center of the cross correlation? that is really confusing ...
0
votes
1answer
129 views

Matlab: integrate function in dependence of a parameter

I am a matlab beginner and can not spot the mistake in the following code: ...
1
vote
1answer
326 views

Generate random numbers with a modified PERT distribution

I want to generate random numbers based on the modified PERT distribution. The modified PERT distribution is a special case of the beta distribution and is defined as: $$f_X(x) = ...
0
votes
1answer
43 views

Anyone recognize this pattern? Plotting relationship between two parameters and their response.

First time asking a question here so hopefully I can provide enough information to you guys without explaining more than necessary. I'm doing some amateurish numerical analysis in MATLAB on some ...
2
votes
1answer
111 views

Fourier series of oscillation in form $\cos(2 \pi \frac{k}{T}+\phi)$

I would like to calculate the fourier coefficients of $\cos(2 \pi \frac{k}{T}+\phi)$ where $T \in \mathbb{N}$ is the period and is arbitrary but fixed, $k \in [1, N-1]$ is the number of oscillations ...
0
votes
1answer
43 views

Sorting and removing data in MATLAB

I am new to MATLAB and I have to analyze a file containing lighting data from WWLLN. The data file contains: latitude of stroke in first row, and longitude of stroke in second row This file has ...
2
votes
2answers
1k views

Matlab Code to simulate trajectories of Ito process.

I need some help to generate a Matlab code in order to do the following question. Can somebody help me in this regard. Any sort of hint that could be helpful will surely be appreciated.. Q: "Simulate ...
2
votes
1answer
304 views

Differentiation of a parametric function using MATLAB or Maple

I'm doing some mathematical calculation of some symbolic math that includes multiplication and differentiation of some matrices. Some of the parameters in my calculations are functions of time. for ...
6
votes
2answers
614 views

Image Reconstruction:Phase vs. Magnitude

Figure 1.(c) shows the Test image reconstructed from MAGNITUDE spectrum only. We can say that the intensity values of LOW frequency pixels are comparatively more than HIGH frequency pixels. $$ ...
1
vote
0answers
516 views

pdf of an uniform distribution in matlab?

I'm reading a book and I came across a problem in which I should generate a uniform random variable and use hist, mean and std ...
2
votes
0answers
127 views

How to solve this complicated differential equation?

I need to know how to solve this complicated differential equation in $z$ either analytically or numerically : \begin{eqnarray} \frac{dx_1}{dz} &=& -ib_1x_1 - ikx_2 \\ \frac{dx_2}{dz} ...