Contenuto principale

addChildStateRow

R2026b

Add child state row to state transition table row

Since R2026b

Description

row = addChildStateRow(parentRow) adds a child state row nested under the existing row parentRow and returns the new row as a Stateflow.StateTransitionTableRow object. The new child row appends to the end of the children of parentRow.

example

Examples

collapse all

Create child states nested inside a parent state row.

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");

Add a parent state row and then add child state rows inside it.

parentRow = addStateRow(stt);
parentRow.Name = "Active";
child1 = addChildStateRow(parentRow);
child1.Name = "Running";
child2 = addChildStateRow(parentRow);
child2.Name = "Paused";

Input Arguments

collapse all

Parent state row under which to add the child state row, specified as a Stateflow.StateTransitionTableRow object.

Output Arguments

collapse all

New child state row, returned as a Stateflow.StateTransitionTableRow object. The row has a RowType of "state". Set the Name property to assign a state name to the row.

Version History

Introduced in R2026b

expand all