| Stateflow User's Guide | ![]() |
Stateflow Represents Control Modes with States
The following example Stateflow diagram has two states, On and Off:
Finite states model objects that have a limited number of states. For example, a house fan or a blender can have states such as High, Medium, Low, and Off. Automatic transmissions in automobiles can have states such as Park, Reverse, Drive, and Low. The preceding example has just two states: On and Off. These states could model a light switch or a single-speed motor.
A state can be active or inactive. If a state is active in Stateflow, you can program activity to take place when it becomes active. For example, if the On state for a fan is made active, this can represent the fact that the fan is now on. If the Drive state for an automatic transmission is active, this can represent the fact that the vehicle using this transmission is moving in the forward direction in highest gear.
| Stateflow Works with Simulink | Stateflow Changes Active States with Transitions | ![]() |
© 1994-2005 The MathWorks, Inc.