Scope Blocks and Scope Viewer Overview - MATLAB & Simulink (original) (raw)

Simulink® scopes provide several methods for displaying simulation data and capturing the data for later analysis. Symbols on your block diagram represent the various data display and data capture methods.

Simulink model showing an example of how Simulink displays a Signal Test Point, a Signal Logging badge, a Signal viewer, a scope block, and a floating scope block.

For more information about these methods:

Scope blocks and Floating Scope blocks both display simulation results, but they differ in how you attach signals and save data. Simulation behavior for a Floating Scope and a Scope Viewer is identical, but you manage them differently in your model.

Capability SimulinkScope Block Simulink Floating Scope Block Simulink Scope Viewer
Attach signals Connect signal lines to a Scope block using input ports. Attach signals interactively from the model before and during a simulation. See Add Signals to Existing Floating Scope or Scope Viewer. Attach signals from the Viewers and Generators Manager, interactively from the toolstrip, or using the signal line context menu.
Access to signals Because signals lines are connected to a Scope block, access signals at different levels of a model hierarchy usingGoTo blocks. Because signals are attached without signal lines, you do not have to route lines to a Floating Scope block.You can access most signals inside the model hierarchy, including referenced models and Stateflow® charts. You cannot access optimized signals. Scope viewers are attached to signal lines. You can access most signals inside the model hierarchy, including referenced models and Stateflow charts. You cannot access optimized signals.
Data logging Save data to a MATLAB® variable as an array, structure, or object. Save data to a MATLAB variable as an object. Save data to a MATLAB variable as an object.
Simulation control Run, forward, and back toolbar buttons. Run, forward, and back toolbar buttons. Run, forward, and back toolbar buttons.
Scale axes after simulation Toolbar buttons to scale _x_-axis and_y_-axis limits.Axes scaling set to Auto for the _x_-axis and_y_-axis. Toolbar buttons to scale _x_-axis and_y_-axis limits.Axes scaling set to Auto for only the _y_-axis. Toolbar buttons to scale _x_-axis and_y_-axis limits.Axes scaling set to Auto for the _x_-axis and_y_-axis.
Add to model Add block from Simulink sinks library. Add block from Simulink sinks library. Add using Viewers and Generators Manager.
Visual indication in model Scope block connected to signals. Floating Scope block not attached to any signal lines. Viewer icons located above signal lines for all attached signals.
Manage scopes centrally No. No. Use the Viewers and Generators Manager to add or delete viewers, and attach or remove signals.
Manage scopes locally Attach signal lines to Scope block in ports. Attach signals from the Floating Scope window. Add viewers and attach additional signals within a model hierarchy using the context menus or from the Scope viewer window.
Simulink Report Generator™ support Yes. Yes. No.
Connect Constant block with Sample time set to inf (constant sample time) Plot the data value at the first time step and anytime you tune a parameter. Plot all data values. Plot the data value at the first time step and anytime you tune a parameter.

If you have a Simulink and a DSP System Toolbox™ license, you can use either the SimulinkScope block or DSP System ToolboxTime Scope block. Choose the scope based on your application requirements, how the blocks work, and the default values of each block.

If you have a DSP System Toolbox license and you have been using Time Scope blocks, continue to do so in your applications. Using the Time Scope block requires a DSP System Toolbox license.

Feature Scope Block Time Scope Block
Location in block library Simulink Sinks library DSP System Toolbox Sinks library
Trigger and measurement panels With Simulink license only: TriggerCursor MeasurementWith DSP System Toolbox or Simscape™ license:Signal StatisticsBilevel MeasurementsPeak Finder TriggerCursor MeasurementsSignal StatisticsBilevel MeasurementsPeak Finder
Simulation mode support for block-based sample timesFor block-based sample times, all the inputs of the block run at the same rate.For rapid-accelerator mode, see Behavior of Scopes and Viewers with Rapid Accelerator Mode. NormalAcceleratorRapid acceleratorExternal Rapid acceleratorExternal
Simulation mode support for port-based sample timesFor port-based sample times, the input ports can run at different rates. No. NormalAccelerator
Frame processing of signals Included in Scope block with DSP System Toolbox license. Included in Time Scope block.
Sample time propagation If the different ports have different sample rates, the scope uses the greatest common divisor of the rates. When using port-based sample times, the different ports of the Scope block inherit the different rates and plots the signals according to those rates.
Save model to previous Simulink release If saving to a release before R2015a, theScope block is converted to a scope with the features available in that release. No change in features.

This table lists the differences in Configuration Property default values between the Scope and Time Scope blocks.

Property Scope Block Default Time Scope Block Default
Open at start of simulation Cleared Selected
Input processing Elements as channels (sample based) Columns as channels (frame based)
Maximize axes Off Auto
Time units None Metric (based on Time Span)
_T_-axis and tick labels Bottom displays only All
Show time-axis label Cleared Selected
Plot type Auto Line
Title % No title
_Y_-axis label No label Amplitude

See Also

Floating Scope | Scope | Scope Viewer | Time Scope (DSP System Toolbox)

Topics