Group Abstract Group Abstract

Message Boards Message Boards

Avoid issues with "ToMatlab" Package?

Posted 8 years ago
6 Replies

Yes sir it worked perfectly. Thank You for your time!

Chris,

Did the copy as plain text and paste work for you?

POSTED BY: Neil Singer

Chris,

Yes. I made my own Mathematica to Matlab converter. I think the one in the Wolfram Library Archive is overly complicated (not meant as a criticism -- it was written nearly 20 years ago and the wolfram language has changed since then).

-Neil

POSTED BY: Neil Singer

Neil,

Thank You for your response. By "your own" do you mean that you have created your own code for converting Mathematica code to MATLAB Syntax?

-Chris

Christopher,

I would also be careful running that ToMatlab package -- Out of curiosity I took a quick look at it and it has at least one bug that I noticed. I use the ArcTan[] function and Mathematica uses the convention of ArcTan[x,y] while MATLAB uses atan2(y,x). I do not see where the ToMatlab function reverses the arguments of the function. There may be other similar cases of incompatibilities that need to be handled. Make sure you check things if you use any non-simple functions.

This is why I wrote my own so that I can be certain of the processing of the functions that I use.

Regards

Neil

POSTED BY: Neil Singer

Christopher,

I have never used the ToMatlab package you described but I wrote my own and do the same task as you are doing. You need to right-click and do "Copy as-> Plain Text" (or Edit menu Copy as plain text). Matlab does not like the default copy format and inserts special characters (which messes up your syntax in MATLAB). I do this once in a while (and periodically forget to do the right type of copy and get the same types of errors you are seeing!)

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard