Introduction to Stateflow with Applications

A finite state machine is a model describing the behavior of a finite number of states, the transitions between those states, and actions. A finite state machine can be represented either by a state diagram or a state transition table.
A state represents an operating mode of a machine, for instance, a typical household portable space heater has four states, off, low, medium, and high.The on state is omitted because the machine (space heater) must be on to operate in the low, medium, and high states.
An action describes the activity that is to be performed. An action can be further classified as an entry action which is performed when entering the state, an exit action which is performed when exiting the state, and as a transition action which is performed during a transition.
A condition is a Boolean expression that can be true (logic 1) or false (logic 0). In Stateflow, conditions are enclosed in square brackets.
An event is an action that can trigger a variety of activities. For example, in a typical household space heater a switch allows a transition to occur between medium state and high state. Thus, event driven systems allow the transition from one operating mode to another in response to events and conditions. Event driven systems can be implemented as finite state machines.
Stateflow provides us the necessary graphical objects to construct finite state machines. Like Simulink, we can drag and drop...