| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Stateflow |
| Contents | Index |
| Learn more about Stateflow |
| On this page… |
|---|
What Is a Finite State Machine? Finite State Machine Representations |
A Stateflow® chart is an example of a finite state machine. A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system makes a transition from one state (mode) to another, if the condition defining the change is true.
For example, you can use a state machine to represent the automatic transmission of a car. The transmission has these operating states: park, reverse, neutral, drive, and low. As the driver shifts from one position to another, the system makes a transition from one state to another, for example, from park to reverse.
Traditionally, designers used truth tables to represent relationships among the inputs, outputs, and states of a finite state machine. The resulting table describes the logic necessary to control the behavior of the system under study. Another approach to designing event-driven systems is to model the behavior of the system by describing it in terms of transitions among states. The occurrence of events under certain conditions determine the state that is active. State-transition charts and bubble charts are graphical representations based on this approach.
A Stateflow chart uses a variant of the finite state machine notation established by Harel [1]. A chart is a graphical representation of a finite state machine, where states and transitions form the basic building blocks of the system. You can also represent stateless charts (flow graphs). You can include Stateflow charts as blocks in a Simulink® model. The collection of Stateflow blocks in a Simulink model is the Stateflow machine.
A Stateflow chart enables the representation of hierarchy, parallelism, and history. You can organize complex systems by defining a parent and offspring object structure [2]. For example, you can organize states within other higher-level states. A system with parallelism can have two or more orthogonal states active at the same time. You can specify the destination state of a transition based on historical information. These characteristics go beyond what state-transition charts and bubble charts provide.
Notation defines a set of objects and the rules that govern the relationships between those objects. Stateflow chart notation provides a way to communicate the design information in a Stateflow chart.
Stateflow chart notation consists of these elements:
A set of graphical objects
A set of nongraphical text-based objects
Defined relationships between those objects
See Stateflow Chart Notation, for detailed information on Stateflow chart notation.
Semantics describe how to interpret chart notation. A typical Stateflow chart contains actions associated with transitions and states. The semantics describe the sequence of these actions during chart execution.
For a description of default semantics, see Stateflow Chart Semantics.
![]() | Stateflow Chart Concepts | Stateflow Charts and Simulink Models | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |