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$
2
  • $\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
    Commented Feb 19, 2018 at 10:09
  • $\begingroup$ Thanks again. I will try it. $\endgroup$ Commented Feb 19, 2018 at 10:12

1 Answer 1

1
$\begingroup$

There is a bug fixed version of ToMatlab:

https://pastebin.com/TcjErHVT

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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