sfgco

Selected objects in chart

Description

example

object = 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. Zoom in on the state by entering:

myState = sfgco;       % Get handle to selected state
myState.fitToView;     % Zoom in on the selected state

In the Stateflow Editor, simultaneously select several states by clicking each state while pressing the Shift key. Display the names of the states by entering:

myStates = sfgco;      % Get vector of handles to selected states
myStates.get('Name')   % Display the names of the selected states

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.
Introduced before R2006a