stateflow
Open Stateflow template page
Syntax
Description
stateflow
opens the Stateflow® section of the Simulink® Start Page. In this section, you can select templates for several
common chart types, including models that contain nested or parallel states.
This image shows the template list as it appears in the Simulink Start Page.
Examples
Use the Simple Stateflow Chart template to create a Stateflow chart with two states. For more information about designing a simple Stateflow chart, see Create Stateflow Charts.
Use the stateflow
command to open the Stateflow section of the Simulink Start Page. Click Simple Stateflow
Chart.
Use the Heirarchical Chart template to create a Stateflow chart with nested child states. For more information about parent and child states, see Create Parent and Child Operating Modes.
Use the stateflow
command to open the Stateflow section of the Simulink Start Page. Click Heirarchical
Chart.
Use the Simple State Transition Table template to create a state transition table with two states. For more information about state transition tables, see Model Finite State Machines Using State Transition Tables.
Use the stateflow
command to open the Stateflow section of the Simulink Start Page. Click Simple State Transition
Table.
Since R2025a
Use the Chart with Reusable Logic template to create a Stateflow chart that includes a MATLAB Function, a Simulink Function, and a graphical function. For more information about reusable logic, see Reuse MATLAB Code by Defining MATLAB Functions and Reuse Simulink Functions in Stateflow Charts.
Use the stateflow
command to open the Stateflow section of the Simulink Start Page. Click Chart with Reusable
Logic.
Since R2025a
Use the Chart with Parallel States template to create a Stateflow chart with two parallel states. For more information about parallel states, see Execute States in Parallel.
Use the stateflow
command to open the Stateflow section of the Simulink Start Page. Click Chart with Parallel
States.
Use the Moore Chart template to create a Moore chart. A Moore chart is a Stateflow chart where the outputs do not depend on inputs, previous outputs, or temporal logic. For more information about Moore charts, see Overview of Mealy and Moore Machines.
Use the stateflow
command to open the Stateflow section of the Simulink Start Page. Click Moore Chart.
Version History
Introduced before R2006aTo quickly set up a Stateflow charts or state transition table, use an updated template in the Simulink Start Page. Stateflow templates now include:
Tips and links to the Get Started with Stateflow category
Singal lines to Inport (Simulink) and Outport (Simulink) blocks in Simulink
The Start Page also contains these new templates:
Chart with Reuseable Logic
Chart with Parallel States
The stateflow
function opens the Simulink template page for Stateflow instead of creating an untitled Simulink model and opening the Stateflow block library.
To create a model that contains an empty chart block, use the
sfnew
function. To open the Stateflow block library, use the sflib
function.
The stateflow
function creates an untitled Simulink model that contains an empty Stateflow chart and opens the Stateflow block library without error.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)