How to translate codes written in Maple into Matlab?
2 views (last 30 days)
Show older comments
Many mathematical equations I wanted to convert those code written in maple into the Matlab program code. How can I do that, and if so, how?
0 Comments
Answers (1)
Walter Roberson
on 31 Jan 2020
In Maple
with(CodeGeneration);
Matlab(EXPRESSION)
This will generate unoptimized MATLAB code. You can add the option optimize=true to generate optimized MATLAB code.
All of the generated code will have the numbers in floating point. X^2 is likely to get coded as X.^0.2E1 for example. Thereare also few spaces. It can be a bit difficult to read.
I wrote some maple code to do the conversion with more natural numeric export, and with spacing to make it easier to read. Unfortunately it doesn't seem to work on all expressions and I have not figured out why not.
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!