Main Content

view

Display object in editing environment

Description

example

view(object) displays an object in its editing environment, such as the Stateflow®, MATLAB®, and Simulink® Editors.

  • The Stateflow Editor displays the contents of these objects:

    • Stateflow.AtomicBox

    • Stateflow.AtomicSubchart

    • Stateflow.Box with IsSubchart set to true

    • Stateflow.Chart

    • Stateflow.Function with IsSubchart set to true

    • Stateflow.State with IsSubchart set to true

  • The Stateflow Editor shows these objects in their subviewer:

    • Stateflow.Annotation

    • Stateflow.Box with IsSubchart set to false

    • Stateflow.Function with IsSubchart set to false

    • Stateflow.Junction

    • Stateflow.Port

    • Stateflow.State with IsSubchart set to false

    • Stateflow.Transition

  • The MATLAB Function Editor displays the code for Stateflow.EMChart and Stateflow.EMFunction objects.

  • The Simulink Editor displays the block diagram for Stateflow.SimulinkBasedState and Stateflow.SLFunction objects.

  • The Truth Table Editor displays the content of Stateflow.TruthTable and Stateflow.TruthTableChart objects.

  • The State Transition Table Editor displays the content of Stateflow.StateTransitionTableChart objects.

  • The Model Explorer displays the properties of these objects:

    • Stateflow.Data

    • Stateflow.Event

    • Stateflow.Message

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')

Access the Simulink.Root object at the top level of the Stateflow hierarchy.

rt = sfroot;

Find the state named A.

st = find(rt,'-isa','Stateflow.State','Name','A');

Display the state in the Stateflow Editor.

view(st);
Introduced before R2006a