Main Content

sfgco

Selected objects in chart

Description

example

objects = sfgco returns a handle or vector of handles to the most recently selected Stateflow® objects. If more than one chart is open, the function searches the last chart with which you interacted that is still open.

Examples

collapse all

In the Stateflow Editor, select a state by clicking on it.

Access the Stateflow.State object.

myState = sfgco;

Zoom in on the selected state.

fitToView(myState)

In the Stateflow Editor, simultaneously select several states by clicking each state while pressing the Shift key.

Access the Stateflow.State objects.

myStates = sfgco;

Display the names of the selected states.

get(mystates,"Name")

Output Arguments

collapse all

Selected graphical objects, returned as a handle or vector of handles to Stateflow API objects. This table describes the format and content of the output of the function, depending on your selection.

ValueDescription
Empty matrixYou have not opened or edited any charts.
Handle to the chart most recently clickedYou clicked in a chart, but did not select any objects.
Handle to the selected objectYou selected one object in a chart.
Vector of handles to the selected objectsYou selected multiple objects in a chart.
Vector of handles to the most recently selected objects in the most recently selected chartYou selected multiple objects in multiple charts.

Version History

Introduced before R2006a