Custom Code

Include custom code for simulation and code generation

By incorporating custom code written in C or C++, augment the capabilities of your Stateflow® chart and take advantage of your preexisting code.


Reusable Functions in Charts

Specify function calls in states and transitions.

Reuse Custom Code in Stateflow Charts

Integrate preexisting custom code into Simulink® models.

Share String Data with Custom C Code

Pass string data between Stateflow charts and custom C code.

Integrate Custom Structures in Stateflow Charts

Define custom Stateflow structures in C code.

Access Custom Code Variables and Functions in Stateflow Charts

Call custom code functions from your Stateflow charts.

Specify Relative Paths to Your Custom Code

Define relative folder paths for custom code integration.

Featured Examples