Main Content

Reusable Functions in Charts

State actions and transition conditions can be complicated enough that defining them inline on the state or transition is not feasible. In this case, express the conditions or actions using one of the following types of Stateflow® functions:

Use the function format that is most natural for the type of calculation required in the state action or transition condition.

If the four standard types of Stateflow functions do not work, you can write your own C or C++ code for integration with your chart. For more information about custom code integration, see Reuse Custom Code in Stateflow Charts.

Related Topics