| Contents | Index |
| On this page… |
|---|
Use the Stateflow API method fitToView to zoom in on a graphical object in the chart. (See Using the API in the Stateflow API documentation for information about obtaining object handles.)
You can zoom the following chart objects:
Charts
Subcharts
States
Transitions
Graphical functions
Truth table functions
MATLAB functions
Simulink functions
Connective junctions
History junctions
Boxes
Notes
Follow these steps to zoom in on different states:
At the MATLAB command prompt, type:
old_sf_car;
The chart shift_logic appears.
To define an object handle for the chart shift_logic, type:
myChart = find(sfroot,'-isa','Stateflow.Chart','Name', ... 'shift_logic');
To define an object handle for the state upshifting, type:
myState = find(sfroot,'-isa','Stateflow.State','Name', ... 'upshifting');
To zoom in on the state upshifting, type:
myState.fitToView;
The chart zooms in on the state and highlights it.
To define an object handle for the state downshifting, type:
myState = find(sfroot,'-isa','Stateflow.State','Name', ... 'downshifting');
To zoom in on the state downshifting, type:
myState.fitToView;
The chart zooms in on the state and highlights it.
To zoom out to the chart-level view, type:
myChart.fitToView;
The chart shift_logic reappears.
You can also zoom in on a state using the sfgco function. Follow these steps:
Click any state in the chart.
At the MATLAB command prompt, type:
myState = sfgco;
This command assigns the selected state to the object handle myState.
To zoom in on the selected state, type:
myState.fitToView;
The chart zooms in on the state and highlights it.
![]() | Copying Objects | Using the Editor Object | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |