| Stateflow® | ![]() |
When you use data and event objects as arguments to functions that you call in action language, they are assumed to be defined at the same level in the hierarchy as the action language that references them. If they are not found at that level, Stateflow® action language attempts to resolve the object name by searching up the hierarchy. Data or event object arguments that are 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 following Model Explorer windows show that the data z is defined for state A, but the data x and y are defined for state AA, a substate of A.


The call to function addit from state A can resolve z because it is owned by A. However, it cannot resolve x and y by looking above state A. Therefore, the function call must reference x and y explicitly to their owner, state AA.
There are a variety of functions that you can call in Stateflow action language that use data as arguments. See the following sections:
Only temporal logic operators take events as an argument. See Using Temporal Logic in State Actions and Transitions.
![]() | Using MATLAB® Functions and Data in Actions | Using Arrays in Actions | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |