Stateflow User's Guide Previous page   Next Page

Stateflow Works with Simulink

Stateflow is a tool in Simulink that can be used to represent dynamic control of a control object in a physical plant that you model in Simulink. A control object can be a motor, a pump, or any device that changes the behavior of the model to control its operation. In Stateflow diagrams, you visually model reactions of the control object to physical events from sensors and switches. These reactions make decisions that change the behavior of the Simulink model.

The following diagram depicts a Stateflow block in the Stateflow demo model sf_boiler (type sf_boiler at the MATLAB® prompt):

In the sf_boiler model, the Stateflow block controls a boiler simulated by the Simulink subsystem Boiler Plant Model. If you double-click the Stateflow block in this model, the Stateflow diagram that programs this Stateflow block appears in the Stateflow diagram editor window, as shown.

You can design a model starting with a Stateflow (control) perspective and then later build the Simulink model. You can also design a model starting from a Simulink perspective and then later add Stateflow diagrams. You might have an existing Simulink model that would benefit if you replace Simulink logic blocks with Stateflow diagrams. The approach you use determines how, and in what sequence, you develop various parts of the model.


Previous page  How Stateflow Works Stateflow Represents Control Modes with States Next page

© 1994-2005 The MathWorks, Inc.