Stateflow User's Guide Previous page   Next Page

ml Namespace Operator

The ml namespace operator uses standard dot (.) notation to reference MATLAB variables and functions in action language. For example, the statement y = ml.x returns the value of the MATLAB workspace variable x to the Stateflow data y. The statement y = ml.matfunc(arg1, arg2) passes the return value from the MATLAB function matfunc to Stateflow data y.

If the MATLAB function you call does not require arguments, you must still include the parentheses, as shown in the preceding examples. If the parentheses are omitted, Stateflow interprets the function name as a workspace variable, which, when not found, generates a run-time error during simulation.

In the following examples, x, y, and z are workspace variables and d1 and d2 are Stateflow data:


Previous page  Using MATLAB Functions and Data in Actions ml Function Next page

© 1994-2005 The MathWorks, Inc.