# Tagged Questions

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.

5k views

### Calling MATLAB from Mathematica

How can I call MATLAB functions directly from Mathematica and transfer data/variables between the two systems?
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?
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?
478 views

### Any solution to transfer data between Python and Mathematica

I think Mathematica handles .mat file not very well, python is pretty good at this kind of jobs. In this site, there are plenty of question related to calling Mathematica from Python, or calling ...
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 <...
4k views

### Is there a Mathematica equivalent to MATLAB's logspace? [duplicate]

Possible Duplicate: How can I get exactly 5 logarithmic divisions of an interval? I want to use Table to generate a list of items, but want the indices to ...
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: ...
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 ...
3k views

### Simulate MATLAB's meshgrid function

Here is MATLAB's meshgrid. I came up with these implementations in Mathematica: ...
1k views

### MATLAB To Mathematica: How to implement imshow()

I want to implement the MATLAB imshow function in Mathematica. This is a DensityPlot[] from Mathematica And this is ...
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: ...
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 ...
339 views

### Porting code from MATLAB

I'd like to switch from MATLAB to Mathematica for my research in digital signal processing. I used Mathematica a lot during the '90s but I haven't used it since then, so I might as well be a complete ...
895 views

### Does Mathematica solve transfer functions differently to Matlab?

Please note this is an edit to the same question posed a few weeks back: I'm using Mathematica to derive the transfer functions for a three phase AC/DC inverter. Given below is the code for the ...
2k views

### Equivalent of MATLAB's “hold on” function

I'm making an animation where the number of iterations is known. I tried using Dynamic, as I prefer updating in real time over generating data before plotting. I ...
554 views

### Mathematica-To-MATLAB Dictionary!

Is there a dictionary to translate Mathematica functions and commands to MATLAB?
1k views

### Does Mathematica have a command analogous to ode45 of MATLAB?

Does anybody know if Mathematica has an analogue of MATLAB's ode45 command? I need to solve a second order coupled ODE system of equations.
365 views

### Automatically growing lists as in MATLAB?

Is there a way to add elements to a list at positions outside the current list's length? Something equivalent to the following MATLAB code snippet: ...
439 views

### Approximate minimum degree permutation algorithm in Mathematica

In MATLAB there is a nice implementation of the so called AMD (approximate minimum degree permutation) algorithm named amd (see Online MATLAB Documentation). There is an alternative algorithm called ...
254 views

### What is the Mathematica equivalent for corr2?

What is the Mathematica equivalent for MATLAB's corr2, which gives the correlation coefficient of two 2D matrices?
356 views

### Using the variable in the MATLAB workspace using MATLink or any other packages

I have a program in MATLAB and after I run the program, I get some results in MATLAB's workspace. Now, I need to use these results in Mathematica. What I currently do is that I save the workspace as a ...
449 views

### ContourPlot3D using a Matlab function through MATLink

I have a Matlab function which accepts a 3 dimensional vector and returns a single number. I want to use this through MATLink to make a 3d plot. A unit sphere: ...
172 views

### What is the equivalent of MATLAB's “timealign” function?

What is the equivalent of MATLAB's "timealign" function? Given two sequences (lists of values) and offsets, timealign will insert 0's into sequences to align them so they have the same number of ...
198 views

### Matlab to Mathematica conversion [closed]

Is there a list of corresponding commands between Mathematica and Matlab, including Solve, NSolve, ...
441 views

### Differences between FFT and analytical Fourier Transform

In MATLAB, if I perform an FFT on a simple Gaussian spot with a phase grating: ...
113 views

### Mathematica does not import .mat file correctly [closed]

I have .mat file that contains a binary (0,1) matrix with size 100*100*100. I have used this syntax to import it in mathematica ...
620 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 ...
210 views

### Importing data from Matlab, using data in “NSolve” and send the results back to Matlab

I have generated an image processing code in Matlab. It has several subroutines and in one of them, I should solve a system of 7 nonlinear equations. I use "fsolve" in Matlab to solve this system, ...
176 views

### Mathematica's Singular Value Decomposition different from another math engine [closed]

Iâ€™ve been working with SVD â€“ singular value decomposition. Things werenâ€™t working as expected. Thus, I looked over to Matlab and executed the following code: ...
142 views

### System Identification from test data

I've been looking for a way to model a simple SISO system from test data using Mathematica. Something similar to MATLAB's System Identification Toolkit, that estimates a transfer function from the ...
161 views

### The CorrelationMatrix is equal to corrcoef of Matlab?

How can I generate a matrix which is equivalent to the results of the "correlation coefficients" command (corrcoef) in Matlab? When I make a LinearModelFit, I can get a CorrelationMatrix, but is this ...
822 views

### converting Matlab program to Mathematica code

I have the following Matlab program; ...
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 ...
116 views

### How to apply different colors to different contours

I have searched the forum, I hope this isn't a duplicate question. I try to apply unique color for every contour line with the same elevation. In short, I want to create a MATLAB style contour plot. ...
269 views

### Having trouble translating Matlab fsolve into Mathematica

I searched the site and found that someone said FindRoot is equivalent to fsolve, however, without proper options, ...
360 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 ...
445 views

### Import symbolic variables from Matlab with MATLink

I'm trying to manipulate with Mathematica symbolic expression created in Matlab. I'm using the MATLink package, and I've succedeed in importing numerical variables, but not symbolic ones : ...
358 views

### Making Mathematica function files like in MATLAB

I'm a MATLAB user trying to get familiar with Mathematica. I have long Mathematica sheet that spits out some matrices at the end after much math. I want to run a loop over couple of different initial ...
237 views

### 'eps' equivalent in Mathematica

In Matlab there is a function 'eps'. eps Spacing of floating point numbers. D = eps(X), is the positive distance from ABS(X) to the next larger in magnitude floating point number of ...
339 views

### Export to mat file does not work

I use this command from the Mathematica documentation center Export["1.mat", {"t" -> {{1,2,3}},"u" -> {{4,5,6}}}, "LabeledData"] to save data as mat file ...
122 views

### open Matlab sheet and plot

I have managed to import my data into mathematica, but I can't find a way to show the plot the way it was in the lab (Matlab automatically generated file usually show me a graph). Is there a way ...
1k views

### How to find local minima of a multivariate function with singularity?

I am working on a logistic regression problem which requires minimizing a cost function J[{theta0, theta1, theta2}, X, y] to find the optimal value for fitting ...
641 views

### Translating a “Point-to-Triangle” distance script from MATLAB to Mathematica

Update - Thanks everyone for your responses! After fixing a problem with vector normalization, the code below now works. I'm a new user, and I was attempting to port some Mathematica code from ...
68 views

### Create a Mathematica function that can be called from R or Matlab

I would like to export a function from Mathematica to allow it to be accessed from R and/or Matlab. Is there a way to do this? As an example, suppose I want to export the following (albeit ...
146 views

### plot totally fragmented, WorkingPrecision,matlab comparison

I am trying to plot ...
259 views

### How to use Mathematica in my Problem as I would use it in Matlab

I would like to calculate the convolution of a function with itself for $n$ times. Let $n$ be $10$. For $n=1$, I wont make any calculation and $f0$ is my function, when $n=2$, I will convolve $f0$ ...
99 views

### Transformation Matlab assignments to Mathematica expressions

From a simulation software, I obtain in a matlab file my algebro-differential equations in the following way : C_p_e = C_state/C_c; C_p_f = I_state/I_i; R_p_e = R_r*C_p_f; I_p_e = (Se_p_e-R_p_e)-...
282 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 ...
Let's say I have a $n$x$m$ matrix $M$ in Matlab and I want to substitute the elements of $M$ that exceed $15$ for $-1$. In Matlab I just write M(M>15)=-1 and ...