Questions about the numerical programming language MATLAB.

learn more… | top users | synonyms

2
votes
1answer
105 views

Is R or Matlab currently faster?

The most up-to-date performance benchmarks comparison between R and Matlab that I could find are several years out of date: 1 2 Is anyone aware of a more up-to-date comparison?
0
votes
0answers
59 views

How to use the Freefem++ (or Fenics) for solving 3D Helmholtz equations or Maxwell equations

I recently want to solve the three-dimensional Helmholtz equations with ABCs via the edge element method. But I am familiar with the program of C++/Python (-type) language, so I want to obtain some ...
6
votes
2answers
90 views

Evaluating 6D Gaussian Integral in Matlab

I have to compute the accuracy of a new Gaussian mixture fitting algorithm. One of the tests include computing the probabilities in certain intervals in a 6D hyperspace. Also, the integral of the ...
1
vote
1answer
86 views

What is the algorithm that matlab used in its built-in function 'pca'?

Do anyone know what is the algorithm that MATLAB used in its built-in function "pca"? I have the following data set: 148.9820 55.8438 210.2150 149.3030 56.8891 208.4280 151.4400 ...
1
vote
1answer
78 views

Calculate the machine epsilon in Matlab

How can I calculate the machine epsilon for two numbers then calculate the theoretical limit for machine epsilon in Matlab ?
0
votes
1answer
41 views

How to find max and min bounds of a uncertain function

First I would like to say that I have searched the for uncertain fitting, robust fitting, linear optimization, convex optimization, etc. But I'm lacking the knowledge to solve this problem, and I need ...
0
votes
1answer
58 views

a circular plot from a vector which represents the temperature along the radius surface, which is the same for every radius

I have calculated the temperature of the section of a cylinder, which is subjected to a heat flow on its upper surface. Getting the temperature distribution in the 2D section. As shown in the ...
1
vote
0answers
46 views

Histogram separation energy equation based on Bhattacharyya

I am working in level set method, specially Lankton method paper. I try to implement Histogram Separation (HS) Energy problem (Part III.C). It based on Bhattacharyya to control the evolution of ...
2
votes
2answers
63 views

Parametric spectrum estimation using aryule: difference between Python and Matlab

I have some code illustrating my problem below. As you can see from the results- Matlab is significantly faster than python. It seems that the function which performs the levinson durbin recursion in ...
1
vote
1answer
75 views

How to solve coupled steady laminar diffusion flame jet problem? [closed]

I am trying to solve governing equations of laminar diffusion flame jet for steady state case. In the next step, I will solve for unsteady case. I have non-dimensional continuity, axial momentum, ...
2
votes
2answers
153 views

Visualising Maxwell's equations using MATLAB

I asked this question to help me understand what is going on in one of Maxwell's equations. I am happy with following through the maths on paper now, but would like to use MATLAB to take it one step ...
1
vote
1answer
55 views

Set limits in Matlab plot automatically [closed]

How can I automatically set the limits of my axis to be e.g. 5% bigger than all data contained in the plot? Of course I could calculate the total max/min values for all the stuff I plot but I would ...
2
votes
1answer
73 views

Constructing matrix from eigenvalues, eigenvectors (Inconsistency with Matlab's eig())

Let $F_1$, $F_2$ be the foci points of an ellipse $\mathcal{E}\colon \mathbf{x}^TA\mathbf{x}=1$, $\mathbf{x}\in\mathbb{R}^2$, $A\in\mathbb{S}_{++}^{2}$. Let also $a$, $b$ be the semi-axes of ...
3
votes
0answers
94 views

Efficient assembly of finite element matrix(coupled equations case)

I noticed this post, where spalloc and sparse are recommanded for efficient assembly in Matlab. I personally use sparse assembling for simple cases. However, when it comes to the case of coupled PDE, ...
0
votes
0answers
113 views

Finite differences and Neumann boundary conditions

I am dealing with a highly nonlinear system of two PDEs. I already have a code to solve the system in case of Dirichlet boundary conditions. The explicit system is: $$ \begin{eqnarray*} \partial_{t}u ...
0
votes
0answers
63 views

algorithm Matlab function 'stream2' and 'stream3' use to compute streamline

Can anyone explain how the MATLAB functions: stream2(x,y,z,u,v,startx,starty) and stream3(x,y,z,u,v,startx,starty) compute stream lines from vector data u and v? In the stream2.m file, it calls the ...
0
votes
0answers
70 views

The solution found by the optimization function when exitflag is negative

I'm using Matlab's fmincon to solve a constrained nonlinear optimization for varying sets of parameters in the objective function. I have 2 parameters and have 400 unique combination of these 2 ...
1
vote
1answer
43 views

Open several dependent functions in matlab with scripting

I have several matlab functions and one script that call those functions. Suppose that they are 'a.m' 'f1.m' 'f2.m' and 'f3.m'. The script 'a.m' must open the functions files when it is manually ...
1
vote
2answers
77 views

use Matlab's PDE toolbox to solve PDE with variable coefficients [closed]

I'm new to the PDE toolbox in Matlab. From the PDE specification window of the toolbox, it looks like one can only solve PDE with constant coefficients. How can ...
2
votes
1answer
144 views

Comparing Eigenvectors, Mathematica vs. Matlab

I am trying to create the same out puts in Mathmatica and Matlab, however I am running into trouble aligning the eigenvectors with the eigenvalues, I think the Matlab is doing something slighly more ...
0
votes
1answer
63 views

Permission denied with diary command

I am trying to use the diary function in Matlab: ...
2
votes
4answers
128 views

Open source auto-differentiation for MATLAB?

Are there any open-source auto-differentiation libraries for MATLAB? I am aware of commerical packages such as http://tomopt.com/tomlab/products/mad/ and plenty of C++ libraries, but I can't find much ...
0
votes
2answers
108 views

ode45 solver MATLAB improve time

I am numerically simulating the Mathieu equation using ODE45 and I have to keep changing the parameters delta and epsilon for each simulation to get the required peiodic solution. Following is the ...
0
votes
0answers
44 views

Generating start point in a systematic manner for fmincon

I'm trying to generate start points for my optimization problem in Matlab. At this point Im not worried about feasibility but only a fast way to generate the points from which I could test the ...
1
vote
0answers
40 views

Generating Hessian of the Lagrangian with dynamic number of nonlinear constraints in Fmincon

I'm using interior point algorithm for solving a nonlinear optimization problem and want to provide Hessian of the Lagrangian as part of fmincon to speed up the process (running couple of thousand ...
0
votes
0answers
52 views

Fast way to compute barycentric lagrange interpolation

Is there any fast way to compute the barycentric Lagrange interpolation using matlab? something more faster than using repmat instead of for loops
5
votes
2answers
114 views

Advice on numerical solution for 2D hyperbolic PDE with zero flux boundary conditions

I would like to numerically solve a hyperbolic PDE of the form $\frac{\partial\theta_t}{\partial t}(x,y)+\frac{\partial\left[\theta_t \gamma_t^x\right]}{\partial x}(x,y)+\frac{\partial\left[\theta_t ...
1
vote
1answer
49 views

How can QR iteration with complex matrices produce complex diagonal entries?

In Lapack (zhseqr) and matlab, the eigenvalues of a complex matrix are computed successfully. I notice that QR iteration or algorithm is involved with that process. QR iteration repeats to call QR ...
3
votes
2answers
102 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
26 views

Determine function parameters with neural network

I am currently studying a doctoral thesis in control theory. At the end of every chapter there is a simulation of a relative-with-the-subject problem. I have finished the theory,but for further ...
0
votes
1answer
61 views

Overcoming floating point issues when Inverse does not exist but determinant provides nonzero result

I have an expression (let's say determinant of matrix A) expressed in symbolic form in terms of 2 decision variables x1, x2 and 2 parameters q1 and q2. I'm minimizing this using fmincon for different ...
4
votes
1answer
136 views

Python: Multistart optimization using parallel programming

[I previously asked my question on StackOverflow but this site may be more appropriate] In Matlab, I am currently using the MultiStart as an optimization algo in a parallel setup for a computer ...
0
votes
1answer
121 views

Trying to understand results for anonymous function defined in two different ways

I'm trying to make my code more efficient so exploring alternatives and providing a simplified example here. Here are 3 different versions I thought of for defining an anonymous function in matlab. ...
2
votes
1answer
108 views

Calculating the Derivative using FFT in Matlab

Help! I'm trying to calculate the derivative of a function using FFT in matlab. I've coded the following function to calculate it: ...
0
votes
3answers
153 views

Looking for ways to speed up the numeric evaluation of a symbolic expression in Matlab

{Summary: I have a symbolic expression DCritnF expressed in terms of two variables x1 and x2. I need to find it's numeric value and I used combination of double and subs as given below. ...
0
votes
1answer
88 views

MatLab pde tool box:how to extract the data from the 3D plot

I'm using the Matlab pde tool box to simulate the electric field around a pointed needle.I would like to extract the electric field values at various x and y coordinate values so that I can zero in on ...
0
votes
1answer
89 views

solving underdetermined system of equations with a sparse matrix as input

I am using Matlab to solve Ax=b and my A is very large, sparse, binary and also rectangular. I saw the Matlab backlash \ operator help and it states that if A is rectangular then it will use the QR ...
0
votes
2answers
102 views

Matlab fmincon with zero user-supplied hessian

I have to solve the problem $$\min_x 1^Tx+\frac{\lambda}{2}\|\Omega\mu-x\|_2^2+\frac{\beta}{2}\|x-\bar{\gamma}\|_2^2\quad\text{w.r.t.}\quad Px-c=0,\ \ x\geq0$$ and in order to do that with Matlab I ...
0
votes
1answer
45 views

Matlab represent graphs

Is there a common / good way to represent graphs in Matlab and operate on them? I need to read in an image as a graph and use several algorithms of graph-theory like minimal cut.
1
vote
0answers
33 views

characterising attractors for master equations

I have a master equation for $(x,y,z)$ with the constraint $x+y+z=N$. $x$ can be regarded as the number of animal of a certain species in the whole system. In other words, I have a differential ...
0
votes
1answer
59 views

How to get values from the loop in MATLAB?

Could you tell me please how to obtain separate values of "pi" depending on the value of N (code below)? For example If I write "pi1" I will get a value of "pi" for N(1) where N(1)=100. If I write ...
1
vote
1answer
79 views

Self-Consistent solution of Boltzmann eqn. using Matlab

I am trying to solve Boltzmann eqn: $\frac{e}{m}\tau\vec{E}_x\cdot \nabla_\vec{v}{f(\vec{v})}=f(\vec{v})-f_0(\vec{v})$ where $f_0(v)=\exp{\frac{-m \vec{v}^2}{T}}$ and ...
0
votes
1answer
183 views

Drunken Man in Matlab

I wrote a script that plots the results of the "drunken lamppost" problem in MATLAB. Now I need to create a road-width from -3 to +3, length from 0 to infinity but the drunk can walk just ahead. It ...
1
vote
1answer
52 views

What is Precision-Recall Curve? [closed]

I have a data mining assignment where I make a content-based image retrieval system. I have 20 images of 5 animals. So in total 100 images. My code returns the 10 most relevant images to an input ...
1
vote
1answer
48 views

Is there a reference/source paper for the TUCKER_ALS() in Tensor Toolbox for MATLAB?

TUCKER_ALS computes the best rank-(R1,R2,..,Rn) approximation of tensor X, according to the specified dimensions. I am using MATLAB Tensor Toolbox Version 2.5. I am wondering if I write a paper, how ...
0
votes
2answers
137 views

Systems of nonlinear equations

Consider the nonlinear system of equations $$ (1) \quad qk^2a_1^2E^2+wna_0a_1AE+pnka_0^2a_1E+rn^2a_0^2A^2-rn^2a_0^3A^2+qk^2a_0a_1ABE-qk^2na_0^2E^2=0, $$ $$ (2) \quad ...
1
vote
1answer
88 views

System of nonlinear equations in MATLAB

I've got some problems solving (numerically) this system of equations. \begin{array}{l} 40 \cdot \cos (2t) + 105 \cdot \cos ({\theta _3}) - 75 \cdot \cos ({\theta _4}) - 91.924 \cdot \cos ({337.62}) ...
0
votes
1answer
71 views

Initial estimate of coupled variables while applying implicit euler to solve nonlinear system of odes

I am trying to solve a system of coupled odes having the following three equations. $$ \begin{align} \frac{dn_A}{dt} & = e\left[j(t) - f\, θ_H\sinh\left(\frac{g\,n_A}{T}\right)\right] \\ ...
0
votes
1answer
95 views

Gilbert-Peierls algorithm for LU Decomposition

I searched for Gilbert-Peierls algorithm, but I haven't found anything useful (well, I found this, but it's not working as it should). I think the problem is the second part, and also that those ...