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

Computationally Plotting an Implicit Equation

I have the following equation: $$F(x,y) = \sqrt{ (x^2 y)^{-0.2}}$$ and, $w/o$ a specific question, is there an advisable computational technique for plotting the above $(x,y>0)$? I am ...
3
votes
3answers
3k views

Understanding Fourier transform example in Matlab

I'm studying about Fourier series and transform and I get confused with the following Matlab example of Fourier transformation: ...
-7
votes
2answers
55 views

Converting Mathematica code to matlab code [on hold]

I need a program to converting a long Mathematica code to matlab code because Matlab running very very very faster than Mathematica. I tested matlab.m library for Mathematica but don't work good.
2
votes
1answer
49 views

Creating an ellipsoidal 3D surface

I am trying to find the equation of a 3D ellipsoidal surface. I have thought of two approaches which are schematically shown below: By revolving an elliptical arc over a 3D elliptical path: Or by ...
0
votes
1answer
394 views

Autocorrelation and spectral density in MATLAB

This question is twofold. We have an LTI system that is a first degree Butterworth LP filter with the power TF where fu = 110Hz and ...
0
votes
0answers
28 views

DFT of vector $(0, 1, 2, 3)$

The problem is that my answer is different from answer i get in MATLAB. My answer is $(6, -2-2i, -2, -2+2i)$ while MATLAB answer is $(6, -2+2i, -2, -2-2i).$ In MATLAB i use command ...
2
votes
1answer
15 views

improving symbolic generation of objective function for optimization

I am currently using matlab to solve an optimization problem. I am generating the objective function using the symbolic toolbox. I planned use the symbolic toolbox to calculate the gradient and ...
1
vote
1answer
71 views

Phase shift of two sine curves

How do I determine phase shift of two sine curves (discrete time sampled sine curves) in Matlab. Currently, I have the FFT of these two sine curves, the phase shift is just the delay in time, which ...
1
vote
0answers
28 views

Math notation for expressions using logical (binary) masks on images (matrix)

I need to write up what I have written in matlab: I have an image (that is, a matrix) $K$ and some other matrix of the same size $M$ which acts as a mask which represents the values I would like to ...
0
votes
2answers
46 views

How to use Monte Carlo method to find volume?

So the question asks to use the Monte Carlo method to find the volume of an irregular figure defined as: ...
1
vote
1answer
20 views

Compute $\left(a_{i}A+B\right)^{-1},\qquad i=1,\ldots,N$ efficiently?

I need to compute the inverse matrix: $$(a_i A+B)^{-1}, \qquad i=1,\ldots,N$$ where $N$ is a large number. $A$ and $B$ are general $M\times M$ matrices independent of $i$. The only thing that ...
1
vote
1answer
42 views

MATLAB curve fitting - least squares method - wrong “fit” using high degrees

Anyone here that could help me with the following problem? The following code calculates the best polynomial fit to a given data-set, that is; a polynomial of a specified degree. Unfortunately, ...
0
votes
2answers
48 views

Gaussian noise generation with Matlab

I am a Matlab beginner & need to understand what is going on this code. I know it is for Gaussian noise generation, but what do these variables mean mathematically? ...
0
votes
1answer
33 views

How to define a meshgrid (x,y) between the intersection of two oblique lines.

How can I create a meshgrid to draw a 3d surface in a domain (zone 1) defined by the intersection of two oblique lines in Matlab (see attached figure)1. The variables 0
2
votes
3answers
36 views

MATLAB: matrix multiplication with exponentiation

Normal matrix multiplication computes $C=A*B$, such that $C_{ij}=\sum_k{A_{ik}*B_{kj}}$ I want to compute D, such that $D_{ij}=\sum_k{e^{A_{ik}*B_{kj}}}$ Basically I want to exponentiate each ...
2
votes
0answers
79 views

how to use Matlab ifft to calculate the following integral? [duplicate]

$$R(t)=\int_{-\infty}^\infty\dfrac{\omega e^{i\omega t}}{(3-\omega^2)^{2}+4\omega^2}\,d\omega$$ where t is a integer and $t>0$ I used to calculate this integral by numerical integral,but it seems ...
1
vote
1answer
642 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 ...
1
vote
1answer
22 views

Gauss quadrature on tetrahedron

I have the Weights ${\bf w}=[w_1\,w_2\, w_3\, w_4]=[0.25, 0.25, 0.25, 0.25]/6$ and the points ${\bf x_1}=[0.1381966011250105 , 0.1381966011250105 , 0.1381966011250105]$ ${\bf ...
0
votes
1answer
18 views

Matrix Factorization of lower triangular and unit upper triangular.

So I have a matrix. $$A =\begin{bmatrix} 8 && -3 && 2 && -1\\ -3 && 8 && 0 && 2\\ 2 && 0 && 8 && -3\\ ...
-9
votes
0answers
34 views

fixed point iteration code [closed]

So as I was working out my math with the following equations using the fixed point iteration, I stumbled to wonder if one can ever write a C program, MATLAB (or the likes) for such math. So my ...
0
votes
0answers
25 views

Guassian quadrature

Consider the polynomial $L \in P_5$ defined by $$L(x)=\frac{d}{dx^3}(1-x^2)^4$$ My question is to use a technique similar to the one used in the analysis of the Gaussian quadrature to show that Q has ...
1
vote
1answer
19 views

Replaces data in a matrix with Matlab

A is a matrix (6 ×6) defined as: A= [0.25 0.35 0.46 0.56 0.67 0.78; 0.25 0.37 0.49 0.61 0.73 0.86; 0.25 0.38 0.52 0.66 1.80 1.94; 0.25 0.40 ...
0
votes
0answers
9 views

Optimization of nested models

Hi everyone, I'm programming in Matlab and I have the following optimization problem in calibrating several nested model specifications. Summary: I have two models ($1$ and $2$, $1$ is nested in ...
0
votes
1answer
427 views

convex hull function in matlab

Is there anyway to compute the convex hull of a finite set of points in Matlab and gives the half-space representation as its result? I usually use a toolbox called MPT developed at ETHZ Zurich, but ...
0
votes
1answer
18 views

iterated matrix multiplication in scilab\matlab [closed]

Please help me with my code. I can't write the iteration in codes ...
1
vote
0answers
23 views

recovering of time series in SSA

i am trying to reconstruct time series from SSA ,because according to this link http://en.wikipedia.org/wiki/Singular_spectrum_analysis there is procedure ...
0
votes
1answer
12 views

MINLP optimization with matlab reaching different solutions every run

I have written a program for optimizing a set of generators. I have hourly price and cost data and need to figure out when a generator should run or just stay off. I describe the problem in more ...
0
votes
0answers
14 views

Polynomial Interpolant [duplicate]

I need to find the polynomial using divided differences with respect to these conditions: $ p(1) = 2 $ $ p(2) = 4 $ $ p(3) = 8 $ $ p'(2) = 4ln(2) $ How do I deal with the condition on the first ...
0
votes
2answers
5 views

Generating points from bi variate normal mixture densities

I am asked to generate 200 and 1000 points from a bi-variate normal mixture densities. I am trying to understand the algorithm, not just the matlab code (I have to write it, not use an existing ...
0
votes
1answer
16 views

matlab MINLP optimization with ga

I have written a program for optimizing a set of generators. I have hourly price and cost data and need to figure out when a generator should run or just stay off. There are additional constraints but ...
0
votes
0answers
14 views

How to change 1D Metropolis into 2D?

I've written a MATLAB function to generate random numbers from a given univariate distribution using the Metorpolis algorithm. Here it is: ...
0
votes
1answer
21 views

integer linear programing in matlab with the symbolic toolbox

I am writing a program to optimize a set of generators. I have hourly data and but dont want to necessarily optimize the whole time series. For a similar problem in the past I used the symbolic ...
1
vote
1answer
113 views

Matlab simulation of dog chasing a rabbit pursuit curve.

Hi I'm really struggling with this problem of mine. A rabbit is running along the x-axis (0->∞) with a constant velocity vr and a dog chases the rabbit starting at some point L (0...∞) on the y-axis ...
0
votes
3answers
28 views

determine unit outward normal vector on a curve

It is necessary for me to find unit outward normal vector for the curve: $$\gamma=(x(t),y(t))$$ where $$x(t)=(0.6)\cos(t)-(0.3)\cos(3t)$$ and $$y(t)=(0.7)\sin(t)+(0.07)\sin(7t)+(0.1)\sin(3t)$$ I ...
-1
votes
1answer
60 views

How to draw a 3-D surface between two straight lines [closed]

How can I draw a 3-D surface between two straight lines in Matlab: X=0:0.05:0.25; y1=2*x+1; y2=5*x-2; z=function(x,y)
1
vote
0answers
18 views

Matlab Newton's Method Non-linear system

There is something wrong with this program and I cannot seem to find it. I am trying to calculate the solution of a non-linear system using Newton's method. Matlab keeps saying there is a problem with ...
0
votes
1answer
260 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 ...
2
votes
1answer
67 views

LSQR with matlab

I am trying to use LSQR on matlab to solve a linear equations: $$ aX + bY = Z $$ so I form [a b][X Y]' = Z where a, b and ...
1
vote
1answer
15 views

plotting cone on matlab

Plot the portion of the cone $z=sqrt((x − 1)^2 + y^2)$ inside the cylinder $r = 2$ This is my matlab code. However, I get an error with the ezsurf line. Any ideas as to what I might be doing wrong? ...
0
votes
1answer
16 views

Incomplete Cholesky decomposition conjugate gradient method in Matlab

I have a problem in finding the numerical material that describing in detail for incomplete Cholesky combined with conjugate gradient method by using Matlab. Someone can help me? Many thank in ...
2
votes
1answer
2k 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 ...
0
votes
0answers
28 views

Dense packing of circles in unit circle, matlab code

I'm having real difficulties with a packing problem: Given M circles with equal radius r, determine the maximum radius such that all the circles can be fitted into the unit circle, without overlap. ...
0
votes
1answer
10 views

Log-scale in MATLAB's fplot [closed]

How can one use logarithmic scale when using matlabs fplot? Is it possible?
0
votes
0answers
9 views

Simulate and present normal distribution [migrated]

My task is to compare different methods of simulating normal distribution. For example, I use following code, to generate 2 vectors, each 1000 values (Box-Muller method): ...
0
votes
1answer
23 views

Matlab solution for non-homogenous heat equation using finite differences

Given the following PDE (non-homogenous heat equation): $$ u_t(x,t) = c^2u_{xx}(x,t) + f(x,t) $$ $$ u(0,t) = u(l,t) = 0 $$ $$ u(x,0) = g(x) $$ $$ 0 < x < l ; t > 0 ; c > 0 $$ I wrote the ...
1
vote
3answers
2k views

How to simulate Monty Hall problem in computer?

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1 [but the door is not opened], and the host, ...
2
votes
0answers
31 views

Phase retrieval via SDP (semidefinite program) of 2D test image (Matrix completion)

In SDP based phase retrieval we have intensity measurement (abs(FFT2(x))^2) of the form A(xo) = |ak,x|^2 =b^2, phase retrieval is then find x that obeys A(xo)=b The quadratic measurements can be ...
1
vote
1answer
24 views

Least Squares in Matlab

I'm stuck on part (d) I'm not sure how to code it so that it approximates that function in matlab. I'm also not sure if my (a) thru (c) are correct. But this is what I have so far. ...
0
votes
1answer
23 views

Matlab Recursion Loop

I need to create a loop to answer part c of the following linear algebra question. I'm new to Matlab so this is extremely confusing. I'm not sure how to make a loop that "counts" from 0-25 in order to ...
0
votes
0answers
30 views

Searching solution for solving huge linear system in MATLAB or C

I am encountering a problem that my MATLAB code ran and an error occurs and shows that it is out of memory. My code is using finite element method to solve some complicated kind of integral equation ...