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

Some operation like determinant

we have determinant operation that is like below: $ det(\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix}) $= $ (-1)^{1+1}a(ei-fh)+ ...
1
vote
1answer
22 views

Analytical solution for bound state energies of infinite well

I am trying to find bound state energies assuming infinite potential. I have been told it can be done by analytically solving Right Hand Side and Left Hand Side of an equation such as: ...
2
votes
0answers
45 views

How to find nonnegative solutions of a linear system?

I have a $M$ equation and $N$ variables like this : $ \begin{bmatrix} 3 & 0 & 1 & 0 & -1 & -3 & 2\\ 1 & 2 & 0 & 4 & 0 & 0 & -1\\ 1 & 1 & 0 ...
0
votes
0answers
15 views

Speed of Fisher Kolmogorov Wave equation in Matlab [on hold]

I have a working code for the Fisher Kolmogorov equation. Now I want to find the speed at which the wave is propagating. And that calculation would be : (x coordinate of U at time t+ delta t) - x ...
0
votes
1answer
13 views

How to plot median with 10% and 90% percentiles

I have to make a plot of same data (I do it in Matlab). On the x-axis the time (in seconds) and on the y-axis the response time (in ms). Now I have to do it with "Median with 10% and 90% ...
-4
votes
1answer
24 views

Pleas help me MATLAB! [on hold]

I want to build an algorithm about following; z=linspace(1+i, 10+5i); a=z^2; plot(a) ??? Error using ==> mpower Inputs must be a scalar and a square matrix. It is easy to plot z^2 by hand... but ...
2
votes
1answer
32 views

How to calculate a complex integral with branch cut?

I want to calculate this integral: $$\int_{-\infty}^{\infty} \frac{\exp\left(-i\sqrt{(\xi^2 - k^2)(y -y')} -i\xi(x - x')\right)}{-i\sqrt{\xi^2 - k^2}}d\xi$$ I can not calculate this integral, I can ...
0
votes
1answer
21 views

Simulating a controlled dynamical system

I am try to simulate a controlled dynamical system of the form $$\dot{x}=f(x,\phi(x)),$$ where $\phi$ is the controller. To do so, I am using Octave (an open source version of Matlab). My commands ...
0
votes
0answers
18 views

Matlab Code about evaluating Newton Polynomials

I am trying to write a code for evaluating a newton polynomial with coefficients $a = [a_0 , ... , a_n]$, and nodes $x = [x_0 , ... , x_n]$ at the vector $t$, using nested multiplication. ...
1
vote
0answers
20 views

how does the following parameters affect the peak ( radius ,theta) of the its frequency spectrum?

The following is the similar magnified picture to the second image that it indicates the parameter i am going to talk about. Suppose i am going to fourier transform (DFT) of the following picture ...
0
votes
1answer
31 views

How to plot fourier series in matlab

For homework (with no prior experience in matlab, guh.) I'm asked to do the following: Plot the (2N + 1)-term approximation $$\sum\limits_{k=-N}^N{a_ke^{jk\omega_0t}}$$ where $a_k = ...
1
vote
1answer
17 views

Why is matlab giving me a single answer when I divide by a vector?

I'm attempting to do a stem plot of $\frac{sin(k2D\pi)}{k\pi}$ in matlab. Following is my procedure: ...
2
votes
4answers
49 views

matlab get lower triangular matrix without loop and build in function

I tried to get the lower triangular n x n matrix without using any loop or build in function (except size()). is it even possible? I tried something like this: ...
0
votes
0answers
13 views

How to work around this apparent bug in fmincon (Matlab)?

I try to determine a maximum likelihood estimate using the Matlab routine fmincon. This routine needs as input an initial 'guess' $x_0$. For some values of $x_0$ it gets stuck in an infinite loop, ...
1
vote
0answers
26 views

PDE using $\theta$ method in Matlab

I'm trying to solve this problem numerically in Matlab: $ \left\{ \begin{array}{rl} \frac{\partial P}{\partial t} &= \frac{\partial^2 P}{\partial x^2} \ \ \ (\star) \\ P(x,0) &= 1 \\ ...
0
votes
0answers
34 views

MATLAB linear interpolation

I'm trying to write a MATLAB program to do linear interpolation and to check its accuracy. I have to input $x_0$ and $x_1$ and then generate the data values using $y=e^x$. Then, for a variety of ...
0
votes
1answer
20 views

Iterative Scheme-Programming Matlab

I don't know if this is going to seem like a dumb question, I am new to this and to matlab, but I'm trying to construct an iterative scheme in MATLAB to compute $\sqrt(b)$ for a given b>0, and program ...
0
votes
2answers
16 views

function with moving average on matlab

Do a function that maintains moving average, the function gives the average of all the numbers that have been put in the function. does anyone know how to do this ?
1
vote
1answer
84 views

what is the probability to find the a sequence of 5 or more continuous heads in coin tossing 100 times?

If an unbiased coin is tossed 100 times, what is the probability to find the a sequence of 5 or more continuous heads in the experiment? My Professor says there is no exact way (may be he meant easy ...
0
votes
1answer
30 views

Plotting null and column space of C

I can't figure out how to properly plot the null and column space of a certain matrix $C = \begin{pmatrix} 6 & -12 & 6 \\ 12 & -36 & 18 \\ 18 & -36 & 18 \end{pmatrix} ...
0
votes
2answers
16 views

Matlab Code for substituting numbers in variable matrix

In Matlab, if we input a number matrix say [1 2; 3 4; 5 6], then what should i do so that the output would be of the form $ [(x_i-z)^b \hspace{5mm} y_i]$ where $z$ and $b$ are just variables. ...
0
votes
1answer
14 views

Matlab %e meaning

What does %e mean in matlab? I.e: x = %1.25e I know if you put an e at the end it adds 0s, so does it have something to do with that?
0
votes
1answer
32 views

How can I plot a 2D figure in MATLAB by “connecting the dots”?

I'm an amateur at MATLAB and I know how to do the basic stuff such as plotting functions, writing M files, functions, for loops, etc but I've be tasked to do something I have never done before. I ...
1
vote
1answer
10 views

Working with piecewise answer in MATLAB

Sometimes MatLab gives me answer in piecewise notation, like this: piecewise([1 < x, 0], [abs(x) < 1, -(log(x - 1) - 1)*(x - 1)]) Is it possible to take ...
1
vote
0answers
28 views

How do I compose a voronoi diagram?

I am trying to understand the algorithm of plotting a voronoi diagram. Here is a code I developed using whatever I could get off wikipedia. However the implementation is very slow and the complexity ...
0
votes
0answers
21 views

Resize an image along rows only or columns only in matlab

I'm writing a function in matlab to zoom or shrink an image using bicubic interpolation. However, my function resizes an image along both rows and columns. What if I want to enlarge the image along ...
1
vote
0answers
11 views

Localizing Region-Based Active Contours

I am working in Lankton paper Localizing Region-Based Active Contours that has to do with localized active contours and especially in mean separation energy part. I am stuck in a point that I cannot ...
0
votes
1answer
20 views

Creating a tridiagonal matrix in Matlab with smaller matrices

This is the problem. Given a matrix B = \begin{bmatrix} 6&-1&0\\-1&6&-1\\0&-1&6 \end{bmatrix}. and I = 3 x 3 identity matrix, how can I construct D = \begin{bmatrix} ...
0
votes
0answers
13 views

reducing data that are very close to one another

so, I have this problem. I have to do image analysis to get the boundary of an image. I perform image analysis to get a boundary representation of the object. The problem is, there is an overlap of ...
0
votes
1answer
57 views

MATLAB Mathematics Question

I have an exam coming up and I need help. Please give full coding and explain. I find code very confusing. Thank you very much :) Euler’s Method a. In the Matlab command window, write a procedure ...
0
votes
0answers
14 views

How to correctly apply Newton-Raphson method to Forward Euler method?

I have a differential equation X' = -X - (X^2)/5. I want to solve the differential using Forward Euler Method and then finding the root of it using Newton-Raphson Method. I'm using MatLab for this. So ...
0
votes
0answers
32 views
0
votes
2answers
21 views
0
votes
2answers
28 views
0
votes
0answers
23 views

Differential Equation Model ODE45 Matlab

The following system of differential equations is intended to be solved with the usage of matlabs ode45 function: $\frac{d\theta}{dt} = w(t)$ $\frac{dw}{dt} = \frac{1}{0.85s}(160 rad/s*u(t) - ...
1
vote
1answer
21 views

Use eig and svd syntax in matlab to find complex eigenvalues of a matrix

For matrix $A= \left( \begin{array}{c} 1 & 1 \\ -1 & 1 \\ \end{array} \right) $ when I calculate the eigenvalues (without matlab) , I find $\lambda_1=1+1i$ and $\lambda_1=1-1i$ and when I ...
0
votes
0answers
12 views

Intial conditions for second order differential equations using MATLAB

I'm trying to solve the following differential equation using MATLAB's ode45 $$ y'' = \alpha (e^{-y} -1) - \beta (e^{y} - 1) $$ for given values of $\alpha$ and $\beta$. However I have the initial ...
0
votes
0answers
41 views

How to Extract the dual feasible search directions for the primal-dual potential reduction algorithm?

I am trying to implement the 4.4 Primal-dual potential reduction algorithm introduced in M.S Lobo et al.. Here is a screenshot depicts the algorithm flow: As ...
1
vote
0answers
28 views

Solve linear system with matlab

In my problem, $A$ is a $m \times n$ matrix with $m \geq n$ and $\mathrm{rank}(A)= n$. Let $\Gamma$ be the $(m+n) \times n$ matrix defined by : $$ \Gamma = \begin{bmatrix} A \\ \mathrm{I_{n}} ...
0
votes
0answers
36 views

10 random observations

I have to generate $10$ random numbers with mean $= 22.6$ and standard deviation $= 2.4$. Then I have to see if the $10$ observations appear to be normally distributed. When I generate $10$ random ...
0
votes
1answer
18 views

Computing Polygonal Surface in Matlab

I am given a bunch of points in 3D-space and want to analyze their convex hull. What I am interested in is what kinds of polygons appear on the surface of the convex hull (probably mostly triangles, ...
1
vote
1answer
31 views

Partial Fraction Expansion in MATLAB

I am to use MATLAB to find the partial fraction expansion of the following function. Can this be done in that format or do I have to manipulate the function? Note: This must be done using pure MATLAB ...
0
votes
0answers
11 views

Finding where plots may cross with octave / matlab

I have several data points that are plotted below and I would like to find the frequency value when the amplitude value crosses 4. I've included an example along with the data points in the example ...
2
votes
0answers
30 views

Boundary Conditions for a Finite Difference Approximation of a Sixth Derivative

I am trying to use a finite difference scheme to numerically solve sixth order parabolic equations such as \begin{equation} u_t = u_{xxxxxx} \end{equation} with symmetry conditions \begin{equation} ...
0
votes
1answer
15 views

Overlaying scatter points over world map in MATLAB

I am facing difficulty overlaying lightning location data over a region of the world map. I have lightning location data where the first column contains longitude and the second column latitude. I ...
0
votes
0answers
20 views

Analyzing Cyclic Behavior of the Temperature in an Office Building

let us consider following code ...
0
votes
1answer
49 views

Best program for multiplying many multivariable polynomials

I want to make a table with two columns: The first column will consist of many(possibly hundreds) of polynomials in two variables. The second column will be a function applied to all of the ...
1
vote
0answers
19 views

Use of Matlab to put equation into vector form

Is there a way to put the following equation of a line into vector form using Matlab? $\displaystyle y=\frac{cos(s_n)-cos(s_{n+1})}{sin(s_{n+1}-sin(s_n)}(x-sin(s_n))-cos(s_n)$
0
votes
1answer
35 views

Estimating how much two probability distributions differ

I have two probability distributions A and B. First I would like to estimate how much they differ. In this regard I use as metric the Jensen–Shannon distance (i.e. the square root of Jensen–Shannon ...