# Questions tagged [matlab]

Questions related to interoperability between Mathematica and MATLAB, or implementation of MATLAB functionality in Mathematica. This tag is NOT for pure MATLAB question.

156 questions
Filter by
Sorted by
Tagged with
21 views

### Using GradientFilter[] and GradientOrientationFilter[] to reproduce Matlab's gradient() function

In 'gradient' function in MMA, two methods are given to reproduce Matlab's gradient() function. I thought that ...
103 views

### Use function defined in Mathematica from Matlab

This question is the same as this post which was closed too early to be answered and efforts to reopen it were unsuccessful. How could we use a defined function inside Mathematica from Matlab? With ...
173 views

### Call function defined in Mathematica from Matlab [closed]

Is it possible to call a defined function inside Mathematica like InterpolationFunction[...] from Matlab? Thanks!
99 views

### Cannot open MATLAB from MATHEMATICA

I am using MATLAB R18 and MATHEMATICA 12. I downloaded MATlink to the directory generated by the command: ...
432 views

### Compare MMA program with MATLAB program by plotting the same equation

Cross-posted in Wolfram Community. Firstly, the MATLAB program is ...
77 views

### Surface crossing itself plotted from x,y,z data

In Matlab I am generating this surface for example. It is plotted in for loop, so in each iteration I plot one ellipse or whatever itself crossing curve. Number of iteration is high so it produce ...
894 views

### How can I generate the same random number in Mathematica and MATLAB?

As a part of my research studies, I have developed a code which is essentially based on random generation of numbers. The first version of the code was written in MATLAB, however, for some reasons I ...
1 vote
99 views

### How to express number in exponential decimal such as 1e2=100?

I am using MATLAB for a long time, and usually I express the number as exponential decimal such as x = 1e2; % x=100 However, if I write this form in mathematica, ...
92 views

### Matlab code to Mathemtica, Tensor

I am trying to convert a Matlab code to Mathematica. I have a tensor, RF (a,b,c,d) which is constructed from Hamiltonian (Hs) and 2x2 identity matrix (DS): ...
137 views

### Implementing an optimization algorithm in WL

I am trying to implement the Jaya optimization algorithm (Jaya). This is a flowchart from the Author 's webpage showing the details of the Algorithm. Note that there is a typo in the equation in the ...
1 vote
131 views

### 'quiver' function in MMA (quiver(x,y,u,v))

How to calculate Quiver using the "quiver function" ("Matlab-like")? quiver(x,y,u,v) plots vectors as arrows at the coordinates specified in each corresponding pair of elements in ...
366 views

How to calculate Numerical gradient of 2D arrays using the "gradient function" ("Matlab-like")? "[___] = gradient(F,hx,hy,...,hN) specifies N spacing parameters for the ...
187 views

### Create a matrix without definition of dimensions

is it possible to define a matrix without giving its dimensions in Mathematica, e.g. First line: mattest[[1,2]] = 1; Second line: ...
1 vote
186 views

### ListContourPlot in Mathematica

I tried to plot the following curves in Mathematica using "ListContourPlot" , and compared them with the results from Matlab 2019a. Mathematica code: (cite from Reference (1)) ...
236 views

### Diagonal matrix command in Mathematica

How to find the corresponding Mathematica commands for diagonal matrix operation in Matlab, e.g. AA=rand(3,3); Step 1.) finding the diagonal elements, and export ...
358 views

### Need help to convert a Matlab script into a Mathematica script?

I would like to convert a small script but a little technical in Mathematica language. Here is the Matlab script : ...
1 vote
175 views

### Import matlab MAT-format fails

As I did many times before, after updating Mathematica v12.2 I have problem to import matlab *.mat file: I checked ...
113 views

### How to determine the file type of a .m file?

Both Mathematica and MATLAB widely uses .m files, but with diametrically different syntaxes and usage. Currently WRI is moving towards the ...
540 views

I have to calculate a 2-dimensional radially symmetric distribution from a single projection. I know that InverseRadon should actually do the job, but I get the ...
527 views

236 views

### Multidimensional MATLAB conversion

I try to convert this MATLAB code: From: https://github.com/gpeyre/2013-SIIMS-ot-splitting/blob/master/code/toolbox/%40staggered/interp.m https://github.com/gpeyre/2013-SIIMS-ot-splitting/blob/master/...
1k views

### Surface plot for matrices (Matlab-Mathematica)

Now I am try to convert matlab file to mathematica, This is the original Matlab command, surf, for making surface plots: ...
1 vote
90 views

### Drawing a surface using an Excel file

I’m totally new to Mathlab. I have the following ‘grid data’ to be read from ‘Office Excel’ that I need them to be drawn as a surface in the Mathematica or Mathlab. I’ve done this with the ‘Surface’ ...
270 views

### How to automatically load the ToMatlab toolbox when opening the software? [duplicate]

I would like to convert the formula to Matlab, but each time I want to run the ToMatlab file, is there any way to automatically load the ToMatlab component when launching the software?
1 vote
342 views

### Convert MATLAB Code to Mathematica

I have written a MATLAB code as following, in order to calculate an integration involving Modified Bessel Function with variable limits: ...
224 views

### How can I get rid of extraneous brackets when importing data from MATLAB? [closed]

How can I easily correct this data sequence from MATLAB to one readable in Wolfram Mathematica? The problem is the 2 outer brackets: ({{ ... }}) ...
107 views

### Missing data - reconstructing large gaps with an autoregressive model

I am looking for a similar function as fillgaps in Matlab which helps to "replace missing samples in an otherwise uniformly sampled signal by fitting an autoregressive model to the samples surrounding ...
114 views

### How to call a Matlab user-created function in a .m file from Mathematica?

I have a file called gensys.m where it's defined a function gensys, which I would like to call in the mathematica environment and work with it. I've tried to ...
1 vote