| Contents | Index |
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
![]() | Common Modeling Errors the Debugger Can Detect | Watching Data Values During Simulation | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |