Stateflow    

ml Function

You can use the ml function to specify calls to MATLAB functions through a string expression in the action language. The format for the ml function call uses standard function notation as follows:

evalString is a string expression that is evaluated in the MATLAB workspace. It contains a MATLAB command (or a set of commands, each separated by a semicolon) to execute along with format specifiers (%g, %f, %d, etc.) that provide formatted substitution of the other arguments (arg1, arg2, etc.) into evalString.

The format specifiers used in ml functions are the same as those used in the C functions printf and sprintf. The ml function call is equivalent to calling the MATLAB eval function with the ml namespace operator if the arguments arg1,arg2,... are restricted to scalars or string literals in the following command:

Stateflow assumes scalar return values from ml namespace operator and ml function calls when they are used as arguments in this context. See Inferring Return Size for ml Expressions.

In the following examples, x is a MATLAB workspace variable, and d1 and d2 are Stateflow data:


  ml Namespace Operator ml Expressions