Stateflow.SLFunction

Create Simulink function

Syntax

Simulink_function_new = Stateflow.SLFunction(parent)

Description

The Stateflow.SLFunction method is a constructor method for creating a Simulink® function in a parent chart, state, box, or graphical function. This method returns a handle to the new SLFunction object.

Arguments

parent

Handle to the object for the parent chart, state, box, or function for the new Simulink Function object

Returns

sl_function

Handle to the newly created Simulink Function object

Examples

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

sl_function = Stateflow.SLFunction(sA)

The new Simulink function appears in the upper left corner of state A in the chart. sl_function is a handle to the new Simulink function that you can use to rename the function, set its properties, and execute its methods.

Introduced in R2008b