Main Content

getDefaultState

R2026b

Get default state row from state transition table or parent row

Since R2026b

Description

row = getDefaultState(stt) returns the default state row at the top level of the state transition table stt as a Stateflow.StateTransitionTableRow object. The default state row is the row whose IsDefaultState property is true. If no default state exists, the function returns an empty array.

example

row = getDefaultState(parentRow) returns the default state row among the children of parentRow. If no default state exists among the children, the function returns an empty array.

Examples

collapse all

Retrieve the default state row from a state transition table.

Open a model that contains a state transition table and get a handle to the table.

open_system("myModel")
stt = find(sfroot, "-isa", "Stateflow.StateTransitionTableChart", ...
    Name="mySTT");

Get the default state row at the top level of the table.

defaultRow = getDefaultState(stt);

Input Arguments

collapse all

State transition table from which to get the default state row, specified as a Stateflow.StateTransitionTableChart object.

Parent state row from which to get the default state row among its children, specified as a Stateflow.StateTransitionTableRow object.

Output Arguments

collapse all

Default state row, returned as a Stateflow.StateTransitionTableRow object. The returned row has its IsDefaultState property set to true. If no default state exists, the function returns an empty array.

Version History

Introduced in R2026b

expand all