Skip to Main Content Skip to Search
Product Documentation

Stateflow.State - Constructor for creating state

Syntax

state_new = Stateflow.State(parent)

Description

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

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.

  


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