Main Content

sfroot

Root of Stateflow hierarchy

Description

root = sfroot returns the Simulink.Root object at the top level of the Stateflow® hierarchy of objects. Use the Root object to access all other API objects in your charts. For more information, see Access Objects in Your Stateflow Chart.

example

Examples

collapse all

Open a Simulink® model called myModel. Suppose that the model contains a Stateflow chart with a state named A.

open_system("myModel")

Find the state named A.

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

Zoom in on the state in the Stateflow Editor.

fitToView(st);

Version History

Introduced before R2006a