Skip to Main Content Skip to Search
Product Documentation

Targets You Can Build

Code Generation for Stateflow Charts and Truth Table Blocks

You can generate code for models with Stateflow charts and Truth Table blocks for these uses:

Code Generation for Simulation

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.

Code Generation for Production and 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.

Software Requirements for Building Targets

To build targets for models with Stateflow charts or Truth Table blocks, you must have a license for the software listed:

Target to BuildSoftware to Use
Simulation targetStateflow
Embeddable targetSimulink 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.

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS