This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Code Generation

Use symbolic results in MATLAB®, Simulink®, Simscape™, C, Fortran, TeX, and MathML

Note

MuPAD® notebooks will be removed in a future release. Use MATLAB live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

The results of symbolic computations obtained in MuPAD are often used in numeric MATLAB computations that exclusively use standard double-precision arithmetic. MuPAD provides functions for converting MuPAD expressions to MATLAB, C, Fortran, MathML, and TeX code. You can also convert MuPAD expressions to equations based on the Simscape language.

With these functions, you can convert the results of your exact symbolic computations, done analytically in the MuPAD Notebook, into functions based on numeric computation, ready to be used in other parts of your program. Using the generated MATLAB and Simscape code does not require a license for Symbolic Math Toolbox™.

MuPAD Functions

generate::CGenerate C formatted string
generate::fortranGenerate Fortran formatted string
generate::MathMLGenerate MathML from expressions
generate::MATLABGenerate MATLAB formatted string
generate::optimizeGenerate optimized code
generate::SimscapeGenerate Simscape equation
generate::TeXGenerate formatted string from expressions

Topics

Create MATLAB Functions from MuPAD Expressions

MuPAD notebooks will be removed in a future release. Use MATLAB live scripts instead.

Create MATLAB Function Blocks from MuPAD Expressions

MuPAD notebooks will be removed in a future release. Use MATLAB live scripts instead.

Create Simscape Equations from MuPAD Expressions

MuPAD notebooks will be removed in a future release. Use MATLAB live scripts instead.