Skip to Main Content Skip to Search
Product Documentation

Guidelines for Avoiding Unwanted Recursion in a Chart

Recursion can be useful for controlling substate transitions among parallel states at the same level of the chart hierarchy. For example, you can send a directed event broadcast from one parallel state to a sibling parallel state to specify a substate transition. (For details, see Directed Event Broadcasting.) This type of recursive behavior is desirable and efficient.

However, unwanted recursion can also occur during chart execution. To avoid unwanted recursion, follow these guidelines:

 Do not call functions recursively

 Do not use undirected event broadcasts

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS