Questions related to creating Mathematica functionality inspired by MATLAB--a proprietary numerical computing environment developed by MathWorks. This includes data import/export and other interoperability questions related to MATLAB programs, scripts, or related software.

learn more… | top users | synonyms

41
votes
3answers
5k views

Calling MATLAB from Mathematica

How can I call MATLAB functions directly from Mathematica and transfer data/variables between the two systems?
24
votes
1answer
16k views

Is it possible to export the equations from Mathematica to MATLAB?

Is it possible to export the output expressions from Mathematica computations (e.g., equations) in valid MATLAB syntax?
20
votes
2answers
7k views

Is there an equivalent to MATLAB's linspace? [duplicate]

Does Mathematica have an equivalent to Matlab's linspace? I want to make a list with "start", "stop" and "number of points". What is the neatest way of doing this?
8
votes
3answers
3k views

Simulate MATLAB's meshgrid function

Here is MATLAB's meshgrid. I came up with these implementations in Mathematica: ...
10
votes
2answers
4k views

How to get Matlab data imported with the same dimensions?

I have some Matlab image data with the following dimensions (output is from Matlab): >> size(im) ans = 86 86 3 45 The data imports just fine ...
2
votes
2answers
361 views

NIntegrate over a list of functions

This question is the result of these other two questions. Question 1 and 2. I thought it would be better to ask a new question rather than deleting previous one. I think When ...
7
votes
1answer
5k views

What is the difference between Mathematica and Matlab? [closed]

I am totally a beginner to Wolfram products and I'm searching for a software to solve my math problems with. Like this math problem that I've solved using $\LaTeX$ in ...
11
votes
1answer
352 views

Does NRoots own an abstract counterpart? If not, can we write one?

We know when solving linear algebra equations, despite its abstract syntax, LinearSolve is much faster compared to Solve: ...
3
votes
1answer
445 views

Differences between FFT and analytical Fourier Transform

In MATLAB, if I perform an FFT on a simple Gaussian spot with a phase grating: ...
1
vote
1answer
284 views

Slow evaluation of NIntegrate when used as a pure function

I asked a perhaps related question here. Here is my code in below. The goal is that to define a function which must be integrated numerically. The function itself first is calculated over different ...
12
votes
1answer
663 views

How can I obtain a zero-filled Fourier transform, as produced by MATLAB's fft?

The MATLAB FFT function, fft(X,n), can be used to return the n-point DFT. This effectively extends the original signal, X, to <...
7
votes
2answers
1k views

Dramatic speed difference of code on Matlab and Mathematica

Background: I was trying to convert a Matlab code (fluid simulation, SPH method) into a Mathematica one, but the speed difference is huge. Matlab code: ...
3
votes
1answer
622 views

Numerical integration's speed

Consider this numerical integration of Bessel function: Do[NIntegrate[BesselJ[2, x], {x, 0, 10000}], {i, 1, 100}] // AbsoluteTiming {4.033403, Null} This is ...
2
votes
3answers
198 views

data manipulation in log-log scale

Say that I have the following: y[t_] := 2 + (2/10)*(1 - Exp[-t/11]) timedat = N[Table[{t, y[t]}, {t, 0, 10, 1/1000}]]; How is it possible to construct an ...
-5
votes
5answers
659 views

Translating MATLAB's cell2mat into Mathematica

How I can define a function in Mathematica such that it acts same as the cell2mat command in MATLAB? Example (in MATLAB): ...