| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Sinks
The Scope block displays its input with respect to simulation time.
The Scope block can have multiple axes (one per port) and all axes have a common time range with independent y-axes. The Scope block allows you to adjust the amount of time and the range of input values displayed. You can move and resize the Scope window and you can modify the Scope's parameter values during the simulation.
The Scope Block described here is not the same as the Scope Viewer. For help on the scope viewer, see Things to Know When Using Viewers.
When you start a simulation the Scope windows are not opened, but data is written to connected Scopes. As a result, if you open a Scope after a simulation, the Scope's input signal or signals will be displayed.
If the signal is continuous, the Scope produces a point-to-point plot. If the signal is discrete, the Scope produces a stair-step plot.
Note By default, the Scope block only displays major time step values. However, if a variable-step solver is employed and if the Refine parameter is set to a value greater than 1, minor (intermediate) time step values are displayed in direct proportion to the Refine setting. |
The Scope provides toolbar buttons that enable you to zoom in on displayed data, display all the data input to the Scope, preserve axis settings from one simulation to the next, limit data displayed, and save data to the workspace. The toolbar buttons are labeled in this figure, which shows the Scope window as it appears when you open a Scope block.

Note Do not use Scope blocks inside library blocks that you create. Instead, provide the library blocks with output ports to which scopes can be connected to display internal data. |
The scope block can display one signal per axes. When displaying a vector or matrix signal on the same axis, the Scope block assigns colors to each signal element, in this order:
Yellow
Magenta
Cyan
Red
Green
Dark Blue
The Scope block cycles through the colors if a signal has more than six elements.
You set y-limits by right-clicking an axis and choosing Axes Properties. The following dialog box appears.

Enter the minimum value for the y-axis.
Enter the maximum value for the y-axis.
Enter the title of the plot. You can include a signal label in the title by typing %<SignalLabel> as part of the title string (%<SignalLabel> is replaced by the signal label).
This figure shows the Scope block displaying the output of the vdp model. The simulation was run for 40 seconds. Note that this scope shows the final 20 seconds of the simulation. The Time offset field displays the time corresponding to 0 on the horizontal axis. Thus, you have to add the offset to the fixed time range values on the x-axis to get the actual time.

This figure shows the same output after you click the Autoscale toolbar button, which automatically scales both axes to display all stored simulation data. In this case, the y-axis was not scaled because it was already set to the appropriate limits.

If you click the Autoscale button while the simulation is running, the axes are autoscaled based on the data displayed on the current screen, and the autoscale limits are saved as the defaults. This enables you to use the same limits for another simulation.
Note Simulink software does not buffer the data that it displays on a floating Scope. It can therefore scale the contents of a floating Scope only when data is being displayed, i.e., when a simulation is running. When a simulation is not running, Simulink software disables (grays) the Zoom button on the toolbar of a floating Scope to indicate that it cannot scale its contents. |
You can zoom in on data in both the x and y directions at the same time, or in either direction separately. The zoom feature is not active while the simulation is running.
To zoom in on data in both directions at the same time, make sure you select the leftmost Zoom toolbar button. Then, define the zoom region using a bounding box. When you release the mouse button, the Scope displays the data in that area. You can also click a point in the area you want to zoom in on.
If the scope has multiple y-axes, and you zoom in on one set of x-y axes, the x-limits on all sets of x-y axes are changed so that they match, because all x-y axes must share the same time base (x-axis).
This figure shows a region of the displayed data enclosed within a bounding box.

This figure shows the zoomed region, which appears after you release the mouse button.

To zoom in on data in just the x direction, click the middle Zoom toolbar button. Define the zoom region by positioning the pointer at one end of the region, pressing and holding down the mouse button, then moving the pointer to the other end of the region. This figure shows the Scope after you define the zoom region, but before you release the mouse button.

When you release the mouse button, the Scope displays the magnified region. You can also click a point in the area you want to zoom in on.
Zooming in the y direction works the same way except that you click the rightmost Zoom toolbar button before defining the zoom region. Again, you can also click a point in the area you want to zoom in on.
Note Simulink software does not buffer the data that it displays on a floating scope. It therefore cannot zoom the contents of a floating scope. To indicate this, Simulink software disables (grays) the Zoom button on the toolbar of a floating scope. |
The Save axes settings toolbar button enables you to store the current x- and y-axes settings so you can apply them to the next simulation.
Use the Restore axes settings button to restore the saved settings.

Tip If you select the Save axes settings button on the toolbar, the block specifies its current y-limits as the values of the Y-min and Y-max parameters (see Y-Axis Limits). Similarly, the block specifies its current x-axis limits as the value of the Time range parameter (see General Parameters Pane). |
The Scope Parameters dialog box lets you change axis limits, set the number of axes, time range, tick labels, sampling parameters, and saving options. To display the dialog, select the Parameters button on the toolbar of the Scope block's display
![]()
or double-click the Scope viewer's display.

For information on the General pane, see General Parameters Pane
For information on the Data history pane, see Data History Parameters Pane
You set the axis parameters, time range, tick labels and decimation or sample time in the General pane.
Set the number of y-axes in this data field. With the exception of the floating scope, there is no limit to the number of axes the Scope block can contain. All axes share the same time base (x-axis), but have independent y-axes. Note that the number of axes is equal to the number of input ports.
Change the x-axis limits by entering a number or auto in the Time range field. Entering a number of seconds causes each screen to display the amount of data that corresponds to that number of seconds. Enter auto to set the x-axis to the duration of the simulation. Do not enter variable names in these fields.
Specifies whether to label axes ticks. The options are:
all | Label ticks on the outside of all axes |
inside | Place tick labels inside all axes (available only on scope viewers) |
bottom-axis only | Place tick labels outside the bottom (or only) axes |
none | Do not label ticks |
Use this control to select either a Decimation factor or Sample time interval. Once the selection has been made, enter a number in the data field.
Selecting this option turns a Scope block into a floating scope.
A floating scope is a Scope block that can display the signals carried on one or more lines. You can create a Floating Scope block in a model either by copying a Scope block from the Simulink Sinks library into a model and selecting Floating scope, or by copying the Floating Scope block from the Sinks library into the model window.
To add signals to a floating scope during simulation, you can either click on signals in your block diagram, or use the Signal Selector (for more information on the signal selector, see The Signal Selector) .
To add signals to a floating scope while the simulation is running by clicking on signals:
Open the scope
Select the line to display the signals it carries
It might be necessary to click the Autoscale data button on the floating scope's toolbar to display the signal
You can add multiple lines by holding down the Shift key while clicking another line
Note For you to add signals, the floating scope must have its axes unlocked. Click the Axes lock icon to lock and unlock the axes.
The axes are highlighted in blue when they are unlocked. |
To use the Signal Selector to add signals:
Open the floating scope
Right-click your mouse in the floating scope and select Signal Selection from the pop-up menu
From the displayed list, select the signals to be added to the floating scope
It might be necessary to click the Autoscale data button on the floating scope's toolbar to display the signal
You can have more than one floating scope in a model, but only one set of axes in one scope can be active at a given time. Active floating scopes show the active axes by making them blue. Selecting or deselecting lines affects the active floating scope only. Other floating scopes continue to display the signals that you selected when they were active. In other words, inactive floating scopes are locked, in that their signal displays cannot change.
To specify display of a signal on one of the axes of a multiaxis floating scope, click the axis. Simulink software draws a blue border around the axis.

Then click the signal you want to display in the block diagram or the Signal Selector. When you run the model, the selected signal appears in the selected axis.

If you plan to use a floating scope during a simulation, you should disable signal storage reuse. See "Signal storage reuse" in Optimization Pane for more information.

This pane lets you control the amount of data that the Scope stores and displays. You can also choose to save data to the workspace in this pane. You apply the current parameters and options by clicking the Apply or OK button. The values that appear in these fields are the values that are used in the next simulation.
You can limit the number of data points saved to the workspace by selecting the Limit data points to last check box and entering a value in its data field. The Scope relies on its data history for zooming and autoscaling operations. If the number of data points is limited to 1,000 and the simulation generates 2,000 data points, only the last 1,000 are available for regenerating the display.
You can automatically save the data collected by the Scope at the end of the simulation by selecting the Save data to workspace check box. If you select this option, the Variable name and Format fields become active.
Enter a variable name in the Variable name field. The specified name must be unique among all data logging variables being used in the model. Other data logging variables are defined on other Scope blocks, To Workspace blocks, and simulation return variables such as time, states, and outputs. Being able to save Scope data to the workspace means that it is not necessary to send the same data stream to both a Scope block and a To Workspace block.
Data can be saved in one of three formats: Array, Structure, or Structure with time. Use Array only for a Scope with one set of axes. For Scopes with more than one set of axes, use Structure if you do not want to store time data and use Structure with time if you want to store time data.
To print the contents of a Scope window, open the Print dialog box by clicking the Print icon, the leftmost icon on the Scope toolbar.
To create a figure that looks identical to the Scope window but can be annotated using the Plot Editing Tools, use the simplot command. Only Scope blocks that save data to the MATLAB workspace from the Data history pane are compatible with this command. For example, on the Data history pane for the Scope block in vdp.mdl, check the Save data to workspace option and select Structure with time from the Format list. After running the simulation, a figure can be created with the command
simplot(ScopeData)
The Scope block accepts real signals of any data type supported by Simulink software, including fixed-point and enumerated data types. The Scope block accepts homogeneous vectors.
For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink in the Simulink documentation.
Sample Time | Inherited from driving block or can be set |
States | 0 |
Multidimensionalized | Yes |
![]() | Saturation Dynamic | Selector | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |