Documentation

Stateflow Hierarchy of Objects

Stateflow® machines arrange Stateflow objects in a hierarchy based on containment. That is, one Stateflow object can contain other Stateflow objects.

The highest object in Stateflow hierarchy is the Stateflow machine. This object contains all other Stateflow objects in a Simulink® model. The Stateflow machine contains all the charts in a model. In addition, the Stateflow machine for a model can contain its own data.

Similarly, charts can contain state, box, function, data, event, transition, junction, and note objects. Continuing with the Stateflow hierarchy, states can contain all these objects as well, including other states. You can represent state hierarchy with superstates and substates.

A transition out of a superstate implies transitions out of any of its active substates. Transitions can cross superstate boundaries to specify a substate destination. If a substate becomes active, its parent superstate also becomes active.

You can organize complex charts by defining a containment structure. A hierarchical design usually reduces the number of transitions and produces neat, manageable charts.

  • To manage graphical objects, use the Stateflow Editor.

  • To manage nongraphical objects, use the Model Explorer.

Was this topic helpful?