主要内容

addStateRowBelow

R2026b

Add sibling state row below existing row in state transition table

Since R2026b

Description

row = addStateRowBelow(existingRow) adds a sibling state row at the same level as the existing row existingRow and returns the new row as a Stateflow.StateTransitionTableRow object. The new row is inserted directly below existingRow.

example

Examples

collapse all

Add multiple state rows at the same hierarchy level using addStateRowBelow.

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 state row and then add a sibling row below it.

row1 = addStateRow(stt);
row1.Name = "Idle";
row2 = addStateRowBelow(row1);
row2.Name = "Active";
row3 = addStateRowBelow(row2);
row3.Name = "Done";

Input Arguments

collapse all

Existing state row below which to add the new sibling state row, specified as a Stateflow.StateTransitionTableRow object.

Output Arguments

collapse all

New sibling 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