| Stateflow User's Guide | ![]() |
Calling Functions in Stateflow
Once you create a graphical function, you use it by calling it in Stateflow action langugage. Any state or transition action in the scope of a function can call that function. The calling syntax is the same as that of the function signature, with actual arguments replacing the formal parameters specified in the signature. If the data types of the actual and formal argument differ, Stateflow casts the actual argument to the type of the formal parameter.
The following example shows a state entry action that invokes a graphical function that returns the product of its arguments.
| Defining Function Data | Exporting Functions | ![]() |
© 1994-2005 The MathWorks, Inc.