Stateflow User's Guide Previous page   Next Page

Noncyclic Behavior Flagged as a Cyclic Example

This Stateflow diagram shows an example of noncyclic behavior that the Debugger flags as being cyclic.

State A becomes active and i is initialized to 0. When the transition is tested, the condition [i < 5] is true. The condition actions that increment i and broadcast the event E are executed. The broadcast of E when state A is active causes a repetitive testing (and incrementing of i) until the condition is no longer true. The Debugger flags this as a cycle when in reality the apparent cycle is broken when i becomes greater than 5.


Previous page  Flow Cyclic Behavior Not Detected Example Watching Data Values with Debuggers Next page

© 1994-2005 The MathWorks, Inc.