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

0
votes
1answer
62 views

Plotting Matrix versus Matrix [closed]

So I recently started using Mathematica and I haven't been able to figure out how to simply plot elements of one matrix versus another matrix which are not directly related or are not a function of ...
0
votes
1answer
77 views

What would be the Mathematica equivalent of sparse in MATLAB?

The sparse function in MATLAB does the following: S = sparse(i,j,v) generates a sparse matrix S from the triplets i, j, and v such that S(i(k),j(k)) = v(k). The ...
1
vote
1answer
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 ...
0
votes
1answer
49 views

Importing data from a MATLAB file to MATHEMATICA [closed]

I have been trying to import some matrices from MATLAB to MATHEMATICA. The matrices are the output after I run the MATLAB file. I had saved that file in .MAT format and trying to import it in ...
1
vote
0answers
74 views

Mapping the MATLAB SP Toolbox to Mathematica

We have some work and people where I am doing signal processing using the signal processing toolbox in MATLAB and it comes up how to translate one or another of the large number of functions in that ...
3
votes
0answers
175 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: ...
1
vote
2answers
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 ...
4
votes
0answers
198 views

Matlab to Mathematica conversion [closed]

Is there a list of corresponding commands between Mathematica and Matlab, including Solve, NSolve, ...
0
votes
1answer
44 views

Lift and projection method in Least Squares Inverse Eigenvalue Problems [closed]

I need to implement the lift and projection method proposed by XUZHOU CHEN AND MOODY T. CHU in http://www4.ncsu.edu/~mtchu/Research/Papers/lsiep.pdf on page 7 in ...
0
votes
1answer
170 views

How to write this Matlab code in Mathematica

I have a small hiccup here. I am trying to write my Matlab code for a dynamical system in Mathematica. I have managed to get most of it except one part. The Mathematica code for the system is <...
3
votes
1answer
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 ...
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: ...
0
votes
1answer
116 views

how to import a matlab 3 dimensional array into mathematica

I have created a three dimensional array "data" in matlab by using the following commands : ...
3
votes
1answer
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: ...
1
vote
0answers
95 views

Theodorus Spiral [closed]

If the successive hypotenuses of the Theodorus Spiral are getting longer but the difference between the lengths is getting smaller reducing the distance between windings to pi, why pi?
4
votes
1answer
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?
0
votes
1answer
86 views

How to import columns of data (.mat file)

I have a two 100x2 .mat file and I would like to get the elements stored as pairwise entries i.e. something like data = [{a1,b1},{a2,b2}..{a100,b100}]. Can someone help me do this efficiently?
0
votes
1answer
177 views

TransferFunctionModel and BodePlot shows different result between Mathematica and Matlab

I was doing the TransferFunctionModel and BodePlot. But the result from Mathematica and Matlab are different. The function is as follows: ...
-3
votes
2answers
128 views

How to convert a matrix to MATLAB format? [duplicate]

I want to convert the following 16x16 matrix containing the variable n and some integers into matlab programming language: ...
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 ...
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 ...
1
vote
1answer
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)-...
2
votes
1answer
820 views
3
votes
0answers
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 ...
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
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, ...
2
votes
1answer
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 ...
2
votes
1answer
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. ...
13
votes
1answer
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 ...
1
vote
0answers
185 views

Is there an equivalent of “pmtm” of MATLAB?

Recently I'm spending my time implementing some patients' analysis using Mathematica Classify function. But I need to rewrite some MATLAB functions for computing ...
2
votes
2answers
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 ...
3
votes
1answer
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 ...
1
vote
1answer
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 ...
3
votes
0answers
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 ...
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: ...
-1
votes
1answer
155 views

Small mismatch in theoretical vs MMA solutions of a damped harmonic oscillator differential equation

I solved the differential equation $$ \ddot y + 0.43 \dot y + y =0.1 \cos(2x), \quad y(0)=1,\ \dot y(0)=1 \quad(0) $$ using both the theoretical results from wikipedia and using MMA (I also tested ...
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?
4
votes
1answer
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 ...
2
votes
1answer
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 : ...
4
votes
1answer
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: ...
2
votes
1answer
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 ...
3
votes
1answer
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, ...
0
votes
0answers
119 views
0
votes
0answers
1k views

Converting a matlab program into Mathematica 10 [closed]

I sought help from this entry at Calling MATLAB from Mathematica to see if I could CONVERT a mathlab program which simulates polymer dynamics that is provided at the download section at http://tx....
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?
4
votes
4answers
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: ...
7
votes
1answer
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 ...
0
votes
1answer
350 views

How to prepare (copy/paste) data from Matlab?

What is the best way to get data from Matlab to Mathematica? For a new project I want to copy/paste a table (or part of it) of datas from Matlab to Mathematica. Copyed from Matlab it is: ...