Main Content

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.

Topics

Reuse Custom Code in Stateflow Charts

Integrate preexisting custom code into Simulink® models.

Configure Custom Code in Library Models

Use custom code for simulation and code generation in library models.

Access Custom C++ Code in Stateflow Charts

You can integrate custom code written in C or C++ with Stateflow charts in Simulink models.

Access Custom Code Variables and Functions in Stateflow Charts

Call custom code functions from your Stateflow charts.

Model Battery Management with Custom Code

Use custom code to design a system for battery management.

Featured Examples