| Contents | Index |
| On this page… |
|---|
You can generate code for models with Stateflow charts and Truth Table blocks for these uses:
Simulation
Production and rapid prototyping
A simulation target is a specification of the generated code, custom code, and build type you use for generating simulation code for Chart and Truth Table blocks in a model.
Whenever you simulate a model that contains Stateflow blocks, Stateflow software generates code that compiles into an S-function MEX file (for details, see S-Function MEX-Files). This code enables the Stateflow blocks to interface with other blocks in a Simulink model, the MATLAB base workspace, and the Stateflow Debugger. This code is not suitable for production or rapid prototyping.
An embeddable target is a specification of the generated code, custom code, and build type you use for generating production code for Chart and Truth Table blocks in a model.
Simulink Coder software can generate embeddable code for Stateflow blocks. This code is optimized for production and rapid prototyping, but does not contain code to interface with other blocks in a Simulink model, the MATLAB base workspace, and the Stateflow Debugger.
To build targets for models with Stateflow charts or Truth Table blocks, you must have a license for the software listed:
| Target to Build | Software to Use |
|---|---|
| Simulation target | Stateflow |
| Embeddable target | Simulink Coder |
The default target type of Simulink Coder code generation is generic real-time (grt). To build other targets, you must have the appropriate license. See Available Targets in the Simulink Coder documentation for more information.
![]() | Building Targets | Choosing a Procedure to Simulate a Model | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |