Stateflow    
stateflow

Open the Stateflow model window.

Syntax

stateflow

Description

stateflow opens the Stateflow model window. The model contains an untitled Stateflow block, an Examples block, and a manual switch. The Stateflow block is a masked Simulink model and is equivalent to an empty, untitled Stateflow diagram. Use the Stateflow block to include a Stateflow diagram in a Simulink model.

Every Stateflow block has a corresponding S-function. This S-function is the agent Simulink interacts with for simulation and analysis.

The control behavior that Stateflow models complements the algorithmic behavior modeled in Simulink block diagrams. By incorporating Stateflow blocks into Simulink models, you can add event-driven behavior to Simulink simulations. You create models that represent both data and control flow by combining Stateflow blocks with the standard Simulink and toolbox blocksets. These combined models are simulated using Simulink.

Example

This example shows how to open the Stateflow model window and use a Stateflow block to create a Simulink model:

  1. Invoke Stateflow.

    The Stateflow model window and an untitled Simulink model containing a Stateflow block are displayed.

  1. Double-click on the untitled Stateflow block in the untitled Simulink model to invoke a Stateflow editor window.



  2. Create the underlying Stateflow diagram.

 sfsave sfprint