This model shows a simple use of combined actions in Stateflow®. Multiple state actions can be combined into a single composite action, making the code more concise. This syntax works for charts with C or MATLAB® as the action language.
CombinedActions shows how the entry and during actions in a state can be combined into a single action.
Note that combining an entry and a during action does not preclude another, separate entry action.
SeparateActions depicts the same code as in
CombinedActions/A, without the use of combined actions.
Collapsing actions that perform the same tasks into composite actions improves the readability of the code. This feature is purely a syntactic construct, with no implications on the semantics of the state. Note that both the
SeparateActions charts produce the exact same output when simulated.