2
$\begingroup$

my question is a duplicate of : Is it possible to export the equations from Mathematica to MATLAB?

I did some symbolic calculations in Mathematica and want to transfer the result to Matlab. The ToMatlab-package is exactly what I need, but sadly it has some flaws, e.g. with atan2.

So, does anybody know a working alternative to the ToMatlab package?

EDIT:

Seems like this is also closey related

UPDATE:

Sadly the provided answer is not working for me. Actually most of the functions under

(*** Special cases of functions ************ 

are not working for me. E.g.

ToMatlab[Log[10, 3]] ==> log(3).*log(10).^(-1);
ToMatlab[Power[E, 2]] ==> exp(1).^2;
$\endgroup$
  • $\begingroup$ I think your best bet is editing this package (I put the atan2 example at the end of this answer after your email). But maybe someone has already updated it and will answer here. $\endgroup$ – Szabolcs Feb 19 '18 at 10:09
  • $\begingroup$ Thanks again. I will try it. $\endgroup$ – user2629617 Feb 19 '18 at 10:12
1
$\begingroup$

There is a bug fixed version of ToMatlab:

https://pastebin.com/TcjErHVT

$\endgroup$
  • $\begingroup$ Does it fix the problem the OP mentioned, i.e. how ArcTan[x,y] is translated? $\endgroup$ – Szabolcs Feb 19 '18 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.