Integrate External Code
Integrate MATLAB functions, Simulink models, and C functions for
communication between Stateflow and external code
Reuse existing algorithms and external programming languages in your chart. Call MATLAB, C, or C++ functions directly from states and transitions. Generate code from the chart for deployment on embedded systems and external applications.
Topics
- Integrate MATLAB Functions in Stateflow Charts
Define the logical behavior of a MATLAB® function.
- Use Custom C or C++ Code in Stateflow Charts
Integrate preexisting custom code into Simulink® models.
- Call Extrinsic MATLAB Functions in Stateflow Charts
Access MATLAB functions that are not supported for code generation.
- Call C Library Functions
Access C functions in state and transition labels.
- Control Function-Call Subsystems
Bind a function-call output event to the activity of a state.
- Synchronize Model Components by Using Events
Use events to communicate with Simulink and MATLAB.