Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Code Generation

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

The results of symbolic computations are often used in numeric codes that exclusively use standard double-precision arithmetic. Symbolic Math Toolbox™ provides functions for generating MATLAB functions, Simulink, function blocks, and equations based on the Simscape language – directly from symbolic expressions.

With these functions, you can convert the result of your symbolic computations into functions based on numeric computation, ready to be used in other parts of your program. Using the generated MATLAB functions does not require a license for Symbolic Math Toolbox. You can also convert symbolic expressions into C, Fortran, MathML, and TeX code.

Functions

matlabFunction Convert symbolic expression to function handle or file
matlabFunctionBlock Convert symbolic expression to MATLAB Function block
simscapeEquation Convert symbolic expressions to Simscape language equations
symReadSSCParameters Load parameters from Simscape component
symReadSSCVariables Load variables from Simscape component
symWriteSSC Create new Simscape component
ccode C code representation of symbolic expression
fortran Fortran representation of symbolic expression
latex LaTeX form of symbolic expression
texlabel TeX representation of symbolic expression

Topics

Generate C or Fortran Code from Symbolic Expressions

Convert symbolic expressions to C or Fortran code.

Generate MATLAB Functions from Symbolic Expressions

Convert symbolic expressions to MATLAB functions that accepts numeric values.

Generate MATLAB Function Blocks from Symbolic Expressions

Convert symbolic expressions to Simulink blocks.

Generate Simscape Equations from Symbolic Expressions

Translate results of symbolic computations to Simscape language equations.

Was this topic helpful?