Stateflow
Model and simulate decision logic using state machines and flow charts
Have questions? Contact Sales.
Have questions? Contact Sales.
Stateflow provides a graphical language that includes state transition diagrams, flow charts, state transition tables, and truth tables. You can use Stateflow to describe how MATLAB algorithms and Simulink models react to input signals, events, and time-based conditions.
Stateflow enables you to design and develop supervisory control, task scheduling, fault management, communication protocols, user interfaces, and hybrid systems.
With Stateflow, you model combinatorial and sequential decision logic that can be simulated as a block within a Simulink model or executed as an object in MATLAB. Graphical animation enables you to analyze and debug your logic while it is executing. Edit-time and run-time checks ensure design consistency and completeness before implementation.
Free Interactive Course
Build state machines graphically by drawing states and junctions connected by transitions. You can also create functions using flow chart notation, Simulink subsystems, MATLAB code, and truth tables.
Create flow charts by drawing transitions that are connected at junctions. The Pattern Wizard lets you create commonly used logic flow patterns. You can use flow charts to design logic for transitioning between states.
Truth tables in Stateflow let you model logic in Simulink when the output depends purely on the current input. State transition tables provide a structured environment for modeling state machines in Simulink.
Visualize system behavior using state diagram animations to highlight active states and transitions in your charts.
Stateflow debugging capabilities let you step through chart execution in detail. You can set breakpoints, monitor data values, and step through different functions in your state diagrams.
Create standalone Stateflow charts that use the full capabilities of the MATLAB language in state and transition actions. Use these charts as MATLAB objects in your applications that require state machine and timing logic.
Accelerate the development of MATLAB applications by using Stateflow to graphically design state machine and timing logic that would be difficult to implement textually.
Create MATLAB applications that include Stateflow chart objects and share them without requiring Stateflow.
You can model conditional, event-based, and time-based logic in Stateflow to invoke Simulink algorithms in a periodic or continuous manner. Orchestrate the execution of components to simulate the scheduling of your real-time environment.
Use event-based and time-based operators (such as after and duration) to specify state-transition logic based on event counts, elapsed time, and denoised signals without having to create and maintain your own timers and counters.
Use Stateflow with other Simulink products to validate your design against requirements.
Generate code for implementation of your Stateflow logic on embedded systems.