Code Generation

Generate C or C++ code from your chart

If you have Simulink® Coder™ or Embedded Coder®, you can generate C or C++ code from models that include Stateflow® blocks.

Topics

Generate C or C++ Code from Stateflow Blocks

Generate code from models that include Stateflow blocks.

Generate Reusable Code for Unit Testing

Store the generated code for part of a Stateflow chart in a separate file.

Generate Reusable Code for Atomic Subcharts

Produce standalone code for linked and unlinked atomic subcharts.

Select Array Layout for Matrices in Generated Code

Implement array data in column-major, row-major, or multidimensional layouts.

Command-Line API to Set Simulation and Code Generation Parameters

Set parameters in the Model Configuration Parameters dialog box programmatically.

Parse Stateflow Charts

Evaluate graphical and nongraphical objects in each Stateflow machine.