Main Content

Stateflow.State

Create state

Syntax

state_new = Stateflow.State(parent)

Description

The Stateflow.State method is a constructor method for creating a state in a parent chart, state, or box. This method returns a handle to the new State object.

Arguments

parent

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

Returns

state_new

Handle to State object for newly created state

Examples

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

state_new = Stateflow.State(sA)

The new state appears in the upper left corner of state A in the chart. state_new is a handle to the State object for the new state that you use to rename the state, set its properties, and execute its methods.

Introduced before R2006a