Stateflow    

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:


  MATLAB Functions and Data ml Function