Skip to Main Content Skip to Search
Product Documentation

Stateflow.EMFunction - Constructor for creating MATLAB function

Syntax

efunction_new = Stateflow.EMFunction(parent)

Description

The Stateflow.EMFunction method is a constructor method for creating a MATLAB function in a parent chart, state, box, or graphical function. It returns a handle to the EMFunction object for the new MATLAB function.

Arguments

parent

Handle to parent chart or state of the new MATLAB function

Returns

efunction_new

Handle to a Function object for the new MATLAB function

Examples

If sA is a handle to a State object for the existing state A, the following command creates a new MATLAB function parented (contained by) state A:

efunction_new = Stateflow.EMFunction(sA)

The new MATLAB function is unnamed and appears in the upper left corner inside state A in the chart. efunction_new is a handle to the EMFunction object, which you use to rename the function, set its properties, and execute its methods.

  


Free Stateflow Interactive Kit

Learn how engineers use Stateflow to model state machines in their Simulink models.


Get free kit

Trials Available

Try the latest version of Stateflow.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS