Documentation

Generate C/C++ Code for Rapid Prototyping or Production Deployment

If you have a Simulink® Coder™ or Embedded Coder® license, you can generate C or C++ code from models that include Stateflow® blocks. The following table directs you to code generation information based on your goals.

GoalSee the Following Information in the SimulinkCoder documentation

Generate C/C++ source code

Code Generation Basics

You cannot generate code only for the Stateflow blocks in a library model. You must first create a link to the library block in your main model and then generate code for the main model.

Generate C/C++ source code and build executable

Program Building, Interaction, and Debugging

Optimize generated code

Reduce Memory Usage for Boolean and State Configuration Variables and Design Tips for Optimizing Generated Code for Stateflow Objects

Include custom code

Integration and Reuse Basics and Integration Options

Include custom code only for library charts in a portable, self-contained library for use in multiple models

Integrate Custom C Code for Library Charts

Was this topic helpful?