Main Content

defaultTransitions

Identify default transitions in specified object

Description

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.

example

Examples

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.

open_system("sfHierarchyAPIExample")
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);
tr1.Destination.Name
ans = 
'A'

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);
tr2.Destination.Name
ans = 
'A1'

Input Arguments

collapse all

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

Tips

  • 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