Finite state machine that uses MATLAB expressions to implement control logic
A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds by making a transition from one operating mode to another. This action occurs in response to an event, as long as the condition defining the change is true.
A Stateflow chart is a graphical representation of a finite state machine, where states and transitions form the basic elements of the system. You can also represent stateless flow charts.
You can use Stateflow charts to control a physical plant in response to events such as a temperature or pressure sensor, or clock or user-driven events. For example, you can use a state machine to represent the automatic transmission of a car. The transmission has these operating states: park, reverse, neutral, drive, and low. As the driver shifts from one position to another, the system makes a transition from one state to another, for example, from park to reverse.
A MATLAB Chart block uses MATLAB® expressions to implement control logic. For more information, see MATLAB as the Action Language for Stateflow Charts.
The MATLAB Chart block accepts input signals of any data type that Simulink® supports, including fixed-point and enumerated data types. For a discussion of data types that Simulink supports, refer to the Simulink documentation.
Floating-point and Boolean inputs pass through the block unchanged.
For a description of the block parameters, see the Subsystem block reference page in the Simulink documentation.
Specified in the Sample time parameter
Yes, if enabled for continuous-time systems
For more information, see When to Enable Zero-Crossing Detection.