Basic MATLAB, Simulink, and Stateflow

Chapter 14: Introduction to Stateflow

14.1 Introduction and Objectives

This final chapter introduces the reader to The MathWorks' Stateflow graphical modeling capabilities. It assumes a basic familiarity with MATLAB and Simulink .

Upon completion of this chapter, the reader will be able to identify the graphics modeling capabilities of Stateflow software, open and close Stateflow models from MATLAB, generate Stateflow models, execute and simulate systems implemented within Stateflow software, and modify Stateflow model block parameters from Simulink and MATLAB.

14.2 Opening, Executing, and Saving Stateflow Models

Stateflow software is an excellent tool to dynamically simulate switching and other state changes within MATLAB's graphical tools, including Simulink. Although Stateflow software was originally developed as a stand-alone graphical modeling environment, it is now combined within Simulink. This offers the important advantage that Simulink blocks can be used with Stateflow blocks within the same model.

To provide the reader with an example of the appearance of a Stateflow model, we will open the following: 1) a Simulink model containing a Stateflow block and 2) the Stateflow library.

First we will open a Simulink model from the MATLAB Command Window. The model we will open is a simple demonstration of While and Do While loops modeled within Stateflow software. To open this model titled sf_while.mdl, simply type the following within the MATLAB Command Window:


The Simulink model window shown in Fig. 14.1 is opened.


Figure 14.1

Note that this model is set to run using a fixed-step discrete...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Modeling and Simulation Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.