Stateflow User's Guide Previous page   Next Page

Creating a Simulink Model with a Stateflow Block

In Simulink, you use blocks to create a simulated model of a physical plant. Stateflow blocks are a part of Simulink models. You use Stateflow blocks in Simulink models to control objects in the physical plant, for example, a motor, a pump, or a fan.

In this topic, you begin the process of building an example model that uses Stateflow on-off control. Create and save a Simulink model with a single Stateflow block in it using the following steps:

  1. At the MATLAB prompt, enter sfnew.
  1. Stateflow displays the following untitled Simulink model window with a Stateflow block labeled Chart.

  1. In the Simulink window, under the Stateflow block, click in the text Chart.
  1. A text cursor appears for you to edit the label of the block.

  1. Replace the text Chart with the text Controller and click outside of the block label when finished.
  1. This gives the Stateflow block the new name Controller, as shown.

    Now that the Stateflow block is labeled Controller, you refer to this block in the Simulink model as the "Controller Stateflow block" or just the "Controller block."


Previous page  Building an On-Off Control Model Saving a Simulink Model Next page

© 1994-2005 The MathWorks, Inc.