| Contents | Index |
When you use data and event objects as arguments to functions that you call in action language, the chart assumes that these arguments appear at the same level in the hierarchy. If the data and event arguments are not at that level, Stateflow action language attempts to resolve the object name by searching up the hierarchy. Data or event object arguments parented anywhere else must have their path hierarchies defined explicitly.
In the following example, state A calls the graphical function addit to add the Stateflow data x and y and store the result in data z.

The call to function addit from state A can resolve z because that data object belongs to state A. However, the function call cannot resolve x and y by looking above state A in the chart hierarchy. Therefore, the function call must reference x and y explicitly to the parent state AA.
For information about functions you can call in Stateflow action language that use data as arguments, see these sections:
Graphical Functions for Reusing Logic Patterns and Iterative Loops
Calling Built-In MATLAB Functions and Accessing Workspace Data
Only operators for event-based temporal logic take events as arguments. See Using Temporal Logic in State Actions and Transitions.
![]() | Calling Built-In MATLAB Functions and Accessing Workspace Data | Using Arrays in Actions | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |