View documentation for other releases
Learn more about Stateflow
• Getting Started
• 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
How the Stateflow Chart Works with the Simulink Model
A Look at the Physical Plant
Running the 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
• 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
• Implementing State Actions
Design Considerations for Defining State Actions and Variables
Writing an Entry Action
Writing a During Action
• 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
• Implementing the Triggers
Design Considerations for Triggering Stateflow Charts
Defining the CLOCK Event
Connecting the Edge-Triggered Events to the Input Signals
• 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 Common Modeling Errors
Debugging State Inconsistencies
Debugging Data Range Violations
• User's Guide
• Stateflow Chart Concepts
• Stateflow Chart Notation
• Stateflow Chart Semantics
• Creating Stateflow Charts
• Modeling Logic Patterns and Iterative Loops Using Flow Graphs
What Is a Flow Graph?
Difference Between Flow Graphs and State Charts
When to Use Flow Graphs
• Creating Flow Graphs with the Pattern Wizard
Why Use the Pattern Wizard?
How to Create Reusable Flow Graphs
Saving and Reusing Flow Graph Patterns
MAAB-Compliant Patterns from the Pattern Wizard
Try It: Creating and Reusing a Custom Pattern with the Pattern Wizard
• Drawing and Customizing Flow Graphs By Hand
How to Draw a Flow Graph
How to Change Connective Junction Size
How to Modify Junction Properties
Best Practices for Creating Flow Graphs
• Enhancing Readability of Generated Code for Flow Graphs
Appearance of Generated Code for Flow Graphs
Converting If-Elseif-Else Code to Switch-Case Statements
Example of Converting Code for If-Elseif-Else Decision Logic to Switch-Case Statements
• Building Mealy and Moore Charts
• Techniques for Streamlining Chart Design
• Defining Data
• Defining Events
• Using Actions in Stateflow Charts
• Making States Reusable with Atomic Subcharts
• Saving and Restoring Simulations with SimState
• Using Vectors and Matrices in Stateflow Charts
• Using Variable-Size Data in Stateflow Charts
• Using Enumerated Data in Stateflow Charts
• Modeling Continuous-Time Systems in Stateflow Charts
• Using Fixed-Point Data in Stateflow Charts
• Using Complex Data in Stateflow Charts
• Defining Interfaces to Simulink Models and the MATLAB Workspace
• Working with Structures and Bus Signals in Stateflow Charts
• Stateflow Design Patterns
• Truth Table Functions for Decision-Making Logic
• Using MATLAB Functions in Stateflow Charts
• Using Simulink Functions in Stateflow Charts
• Building Targets
• Debugging and Testing Stateflow Charts
• Exploring and Modifying Charts
• Semantic Rules Summary
• Semantic Examples
Glossary
• Using the API
• API Object Reference
• API Object Properties and Methods
API Method Reference
• Blocks
• 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
Creating Flow Graphs with the Pattern Wizard
Drawing and Customizing Flow Graphs By Hand
Enhancing Readability of Generated Code for Flow Graphs
Learn how engineers use Stateflow to model state machines in their Simulink models.
Try the latest version of Stateflow.