View documentation for other releases
Learn more about Stateflow
• Getting Started
• Introduction to the Stateflow Product
• Benefits of Stateflow Usage
Models Event-Driven Systems
Extends the Capabilities of Traditional State Charts
Provides Debugging Capabilities
Supports Code Generation in Multiple Languages
What Does a Stateflow Chart Look Like?
How Stateflow Software Works with Simulink Software
Basic Tutorial for Modeling Event-Driven Systems
• Installing Stateflow Software
Installation Instructions
Prerequisite Software
Product Dependencies
Setting Up Your Own Target Compiler
Using Stateflow Software on a Laptop Computer
Related Products
• The Stateflow Chart You Will Build
The Stateflow Chart
How the Stateflow Chart Works with the Simulink Model
A Look at the Physical Plant
Running the Model
• Defining the Interface to the Simulink Model
• Implementing the Interface with Simulink
Build It Yourself or Use the Supplied Model
Design Considerations for Defining the Interface
Adding a Stateflow Block to a Simulink Model
Defining the Inputs and Outputs
Connecting the Stateflow Block to the Simulink Subsystem
• Defining the States for Modeling Each Mode of Operation
• Implementing the States to Represent Operating Modes
Design Considerations for Defining the States
Adding the Power On and Power Off States
Adding and Configuring Parallel States
Adding the On and Off States for the Fans
• Defining State Actions and Variables
• Implementing State Actions
Design Considerations for Defining State Actions and Variables
Writing an Entry Action
Writing a During Action
• Defining Transitions Between States
• Adding the Transitions
Design Considerations for Defining Transitions Between States
Drawing the Transitions Between States
Adding Default Transitions
Adding Conditions to Guard Transitions
Adding Events to Guard Transitions
• Triggering a Stateflow Chart
• Implementing the Triggers
Design Considerations for Triggering Stateflow Charts
Defining the CLOCK Event
Connecting the Edge-Triggered Events to the Input Signals
• Simulating the Chart
• Setting Simulation Parameters and Breakpoints
Prepare the Chart Yourself or Use the Supplied Model
Checking That Your Chart Conforms to Best Practices
Setting the Length of the Simulation
Configuring Animation for the Chart
Setting Breakpoints to Observe Chart Behavior
Simulating the Air Controller Chart
• Debugging the Chart
• Debugging Common Modeling Errors
Debugging State Inconsistencies
Debugging Data Range Violations
• User's Guide
• Blocks
Stateflow Chart
Truth Table
• Functions
Examples
• Release Notes
Symbols A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Learn how engineers use Stateflow to model state machines in their Simulink models.
Try the latest version of Stateflow.