Main Content


Identify default transitions in specified object



transitions = defaultTransitions(parent) returns an array of Stateflow.Transition objects that correspond to the default transitions at the top level of the specified parent object. For more information, see Use Default Transitions to Specify Initial Substate Activity.


collapse all

Find the default transitions in this chart and in state A.

Stateflow chart with a hierarchy of states. The outer state is called A. It contains two inner states called A1 and A2.

Open the model and access the Stateflow.Chart object for the chart.

ch = find(sfroot,"-isa","Stateflow.Chart");

Identify the default transition at the top level of the chart. Display the name of the destination.

tr1 = defaultTransitions(ch);
ans = 

Save the Stateflow.State object that corresponds to state A.

state = tr1.Destination;

Identify the default transition at the top level of the state A. Display the name of the destination.

tr2 = defaultTransitions(state);
ans = 

Input Arguments

collapse all

Parent object, specified as a Stateflow® API object of one of these types:


  • To identify default transitions inside a Stateflow.Box, call the defaultTransitions function on the Stateflow.Chart, Stateflow.Function, or Stateflow.State object that contains the box.

Version History

Introduced before R2006a