| 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… |
|---|
The Stateflow product is an interactive graphical design tool that works with Simulink software to model and simulate event-driven systems, also called reactive systems. Event-driven systems transition from one operating mode to another in response to events and conditions. These systems are often used to model logic for dynamically controlling a physical device such as a fan, motor, or pump. Event-driven systems can be modeled as finite-state machines.
Finite-state machines represent operating modes as states. For example, a house fan can have states such as High, Medium, Low, and Off. To construct finite-state machines, Stateflow software provides graphical objects that you can drag and drop from a design palette to create charts in which a series of transitions directs a flow of logic from one state to another. You can also add:
Input and output data
Events for triggering Stateflow charts
Actions and conditions, which you can attach to states and transitions to further define the behavior of the Stateflow chart
You will learn more about these elements later in this guide.
With the Stateflow product, you can extend the capabilities of traditional state charts by:
Adding hierarchy to charts
Modeling parallel states
Defining functions graphically, using flow diagrams; procedurally, using the MATLAB technical computing environment; and in tabular form, with truth tables
Using temporal logic to schedule events
Defining vector, matrix, and fixed-point data types
Stateflow software performs simulation by generating a C code implementation of the Stateflow chart. The simulation code is generated from a simulation target. You will learn more about simulation targets later in Simulating the Chart.
You can also generate portable C code from Stateflow charts automatically using Stateflow® Coder™ code generation software (available separately). The Stateflow Coder product also works with Real-Time Workshop® code generation software (available separately) to generate C code for Simulink models that include Stateflow charts.
![]() | Introduction to the Stateflow Product | What Does a Stateflow Chart Look Like? | ![]() |

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