主要内容

addDefaultTransitionPathRow

R2026b

Add default transition path row to state transition table

Since R2026b

Description

row = addDefaultTransitionPathRow(stt) adds a default transition path row to the state transition table stt and returns the new row as a Stateflow.StateTransitionTableRow object. This syntax clears all existing default transitions at the chart level.

example

row = addDefaultTransitionPathRow(parentRow) adds a default transition path row under the state row parentRow and returns the new row as a Stateflow.StateTransitionTableRow object. This syntax clears all existing default transitions at the level of the parent row.

example

Examples

collapse all

Create a default transition path row to specify the initial active state.

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 a default transition path row to the table. Then add a transition column and set the destination to the state row.

stateRow = addStateRow(stt);
stateRow.Name = "Idle";
dtRow = addDefaultTransitionPathRow(stt);
cells = addTransitionColumn(stt);
dtCell = getTransitionCell(stt, 2, 1);
dtCell.Destination = "Idle";

Input Arguments

collapse all

State transition table to which to add the default transition path row, specified as a Stateflow.StateTransitionTableChart object.

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

Output Arguments

collapse all

New default transition path row, returned as a Stateflow.StateTransitionTableRow object. The row has a RowType of "default-transition".

Version History

Introduced in R2026b

expand all