SymPy CAS in MATLAB
This function utilizes Python's SymPy module to provide symbolic capabilities for those of us who do not have the Symbolic Toolbox or a version of Matlab with Python support at our disposal. The function passes strings to and from Python via the System command. Computation of the result is easily accomplished via the vectorize and inline functions.
Example:
result = symeval('integrate','"x^2+3x-4"','x');
y = vectorize(inline(result));
plot(y([1:100])
This can be slow since the Python interpreter is started and shutdown every time the function is called. However, successive calls are sped up due to OS caching.
Another option is to use the pymex module posted on this file exchange:
http://www.mathworks.com/matlabcentral/fileexchange/27255-pymex
The best way is to just call the library directly with a version of MATLAB that supports Python.
Zitieren als
Jonathan Lister (2026). SymPy CAS in MATLAB (https://de.mathworks.com/matlabcentral/fileexchange/42787-sympy-cas-in-matlab), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- MATLAB > External Language Interfaces > Python with MATLAB > Call Python from MATLAB >
- Mathematics and Optimization > Symbolic Math Toolbox > Mathematics > Calculus >
- Mathematics and Optimization > Symbolic Math Toolbox > Mathematics > Linear Algebra >
Tags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.4.0.0 | Added image and changed title text...
|
||
| 1.3.0.0 | updated title, description, and other requirements text |
||
| 1.0.0.0 |
