Stateflow | ![]() ![]() |
Creating a Simulink Model
Opening the Stateflow model window is the first step toward creating a Simulink model with a Stateflow block. By default, an untitled Simulink model with an untitled, empty Stateflow block is created for you when you open the
Stateflow model window. You can either start with the default empty model or copy the untitled Stateflow block into any Simulink model to include a Stateflow diagram in an existing Simulink model.
These steps describe how to create a Simulink model with a Stateflow block, label the Stateflow block, and save the model:
At the MATLAB prompt enter stateflow
.
MATLAB displays the Stateflow block library.
The library contains an untitled Stateflow block icon,
an Examples block,
and a manual switch. Stateflow also displays an untitled Simulink model
window with an untitled Stateflow block.
Label the Stateflow block in the new untitled model by clicking in the text
area and replacing the text "Untitled" with the text On_off
.
Choose Save As from the File menu of the Simulink model window. Enter a
model title.
You can also save the model by choosing Save or Save As from the Stateflow graphics editor File menu. Saving the model either from Simulink or from the graphics editor saves all contents of the Simulink model.
![]() | Quick Start | Creating a Stateflow Diagram | ![]() |