Main Content

sfroot

Root ofStateflowhierarchy

Syntax

Description

example

root= sfrootreturns theSimulink.Rootobject at the top level of the Stateflow®hierarchy of objects. Use theRootobject to access all other API objects in your charts. For more information, seeAccess Objects in Your Stateflow Chart.

Examples

collapse all

Open a Simulink®model calledmyModel. Suppose that the model contains a Stateflow chart with a state namedA.

open_system("myModel")

Find the state namedA.

st = find(sfroot,"-isa","Stateflow.State",Name="A");

Zoom in on the state in the Stateflow Editor.

fitToView(st);

Version History

Introduced before R2006a