Documentation

Scope

Display signals generated during simulation

Description

The Simulink® Scope block displays time domain signals with respect to simulation time.

Input signal characteristics:

  • Signal — Continuous (sample-based) or discrete (sample-based and frame-based).

  • Signal data type — Any data type that Simulink supports including real, complex, fixed-point, and enumerated data types. See Data Types Supported by Simulink.

  • Signal dimension — Scalar, one-dimensional (vector), two dimensional (matrix), or multidimensional. Display multiple channels within one signal depending on the dimension. See Signal Dimensions and Determine Output Signal Dimensions.

Scope display features:

  • Simulation control — Debug models from a Scope window using Run, Step Forward, and Step Backward toolbar buttons.

  • Multiple signals — Plot multiple signals on the same y-axis (display) using multiple input ports.

  • Multiple y-axes (displays) — Display multiple y-axes. All of the y-axes have a common time range on the x-axis.

  • Modify parameters — Modify scope parameter values before and during a simulation.

  • Axis autoscaling — During or at the end of a simulation. Margins are drawn at the top and bottle of the axes.

  • Display data after simulation — If a Scope is closed at the start of a simulation, scope data is still written to the scope during a simulation. As a result, if you open the Scope after a simulation, the Scope displays simulation results for attached input signals.

Oscilloscope features:

  • Triggers — Set triggers to sync repeating signals and pause the display when events occur.

  • Data analysis — Measure time and value differences between two signal data points. If you have a DSP System Toolbox™ license, measure signal characteristics including signal statistics, transitions, and peaks.

    Note:   If you want to display internal data from a library block that you create, do not use a Scope block inside the library block. Instead, add output ports to your library block, and then connect the ports to a Scope block external to the library block.

Configuration Properties

Open at simulation start

Specify when a Scope window opens.

Settings

Default: Clear for Scope block. Select for Time Scope block.

Select

Open Scope window when simulation starts.

Clear

Do not open a closed Scope at the start of a simulation.

Scope Configuration property: OpenAtSimulationStart.

Display the full path

Display full block path on Scope title bar.

Settings

Default: Clear

Select

Display block path and name.

Clear

Display block name.

Scope Configuration property: No corresponding property.

Number of input ports

Specify number of input ports on a Scope block, specified by a positive integer string. Maximum number of input ports is 96. This property does not apply to floating scopes and scope viewers.

Default: 1

Scope Configuration property: NumInputPorts.

Layout button

Specify number of displays. The maximum layout dimension is four rows by four columns.

  • If the number of displays are equal to the number of ports, signals from each port appear on separate displays.

  • If the number of displays are less than the number of ports, signals from additional ports appear on the last display.

Settings

Default: 1 display

Scope Configuration property: LayoutDimensions.

Sample time

Specify time interval between Scope block updates during a simulation, specified as a positive real string. This property does not apply to floating scopes and scope viewers.

Settings

Default: -1 for inherited

Scope Configuration property: SampleTime.

Input processing

Specify sample-based or frame-based processing of signals.

Settings

Default: Elements as channels (sample based) for Scope block. Columns as channels (frame based) for Time Scope block.

Elements as channels (sample based)

Process signal values in a channel at each time interval.

Columns as channels (frame based)

Process signal values in a channel as a group of values from multiple time intervals. Frame-based processing is available only with discrete input signals.

Scope Configuration property: FrameBasedProcessing.

Maximize axes

Maximize size of signal plots. Each of the plots expands to fit the full display. Maximizing the size of signal plots removes the background area around the plots.

Settings

Default: Off for Scope block. Auto for Time Scope block.

Auto

If Title and Y-label properties are not specified, maximize all plots.

On

Maximize all plots. Values in Title and Y-label are hidden.

Off

Do not maximize plots.

Scope Configuration property: MaximizeAxes.

Axes scaling

Specify when to scale y-axis to display all signal values.

Settings

Default: Manual

Manual

Manually scale y-axis range with Scale Y-axis Limits toolbar button.

Auto

Scale y-axis range during and after simulation. Selecting this option displays the Do not allow Y-axis limits to shrink check box.

After N Updates

Scale y-axes after specified number of block updates (time intervals). Selecting this option displays the Number of updates text box.

Dependency

If this property is set to After N Updates, also specify the property Number of updates.

Scope Configuration property: AxesScaling.

Do not allow Y-axis limits to shrink

Specify when y-axis range limits can change.

Settings

Default: Select

Select

Allow y-axis range limits to increase but not decrease during a simulation.

Clear

Allow y-axis range limits to increase and decrease.

Dependency

Click the Configure link to the right of the Axes scaling property and set the Axes scaling property to Auto to display this property.

Number of updates

Specify the number of updates that occur during a simulation before a Scope scales the y-axes, specified as a positive integer string.

Settings

Default: 10

Dependency

Display and activate this property by clicking the Configure link to the right of the Axes scaling property and set the Axes scaling property to After N Updates.

Scope Configuration property: AxesScalingNumUpdates.

Scale axes limits at stop

Specify when to scale axes.

Settings

Default: Select

Select

Scale axes when simulation stops.

Clear

Always scale axes.

Dependency

Click the Configure link to the right of the Axes scaling property to display this property.

The y-axes limits are always scaled. The x-axis limits are scaled only if you also select the Autoscale X-axis limits check box.

Y-axis Data range (%)

Specify percentage of y-axis range for plotting data. For example, if you set this property to 100, plotted data uses the entire y-axis range.

Settings

Default: 80

Values are 1 through 100.

Dependency

Click the Configure link to the right of the Axes scaling property to display this property.

Y-axis Align

Specify where to align plotted data along the y-axis data range when Y-axis Data range is set to less than 100 percent.

Settings

Default: Center

Top

Align signals with maximum values at top of y-axis range.

Center

Align signals with maximum and minimum values centered.

Bottom

Align signals with minimum values at bottom of y-axis range.

Dependency

Click the Configure link to the right of the Axes scaling property to display this property.

Autoscale X-axis limits

Scale x-axis range limits when scaling axes.

Settings

Default: Clear

Select

Scale x-axis range to fit all signal values. If Axes scaling is set to Auto, scales the data currently within the axes, not the entire signal in the data buffer.

Clear

Do not scale x-axis range.

Dependency

Click the Configure link to the right of the Axes scaling property to display this property.

X-axis Data range (%)

Specify percentage of x-axis range for plotting data. For example, if you set this property to 100, plotted data uses the entire x-axis range.

Settings

Default: 100

Values are 1 through 100.

Dependency

Click the Configure link to the right of the Axes scaling property to display this property.

X-axis Align

Specify where to align plotted data along the x-axis when X-axis Data range is set to less than 100 percent.

Settings

Default: Center

Top

Align signals with maximum values at top of x-axis range.

Center

Align signals with maximum and minimum values centered.

Bottom

Align signals with minimum values at bottom of x-axis range.

Dependency

Click the Configure link to the right of the Axes scaling property to display this property.

Time span

Specify length of x-axis range to display.

The block calculates the beginning and end times of the time range using the Time display offset and Time span properties. For example, if you set the Time display offset to 10 and the Time span to 20, the scope sets the time range from 10 to 30.

Settings

Default: Auto

Auto

Difference between the simulation start and stop times.

User defined

Value less than the total simulation time.

Scope Configuration property: TimeSpan.

Time span overrun action

Specify how to display data beyond the visible x-axis range.

You can see the effects of this option only when plotting is slow with large models or small step sizes.

Settings

Default: Wrap

Wrap

Draw a full screen of data from left to right, clear the screen, and then restart drawing of data.

Scroll

Move data to the left as new data is drawn on the right. This mode is graphically intensive and can affect run-time performance.

Scope Configuration property: TimeSpanOverrunAction.

Time units

Specify units to display on the x-axis.

Settings

Default: None for Scope block. Metric for Time Scope block.

Metric

Display time units based on the length of Time span.

Seconds

Display Time (seconds).

None

Do not display time units.

Scope Configuration property: TimeUnits.

Time display offset

Offset the x-axis by a specified time value, specified as a real number or vector of real numbers.

For input signals with multiple channels, you can enter a scaler or vector.

  • Scaler — Offset all channels of an input signal by the same time value.

  • Vector — Independently offset the channels.

Settings

Default: 0

Scope Configuration property: TimeDisplayOffset.

Time-axis labels

Specify how x-axis (time) labels display.

Settings

Default: Bottom Displays Only for Scope block. All for Time Scope block.

All

Display x-axis labels on all y-axes.

None

Do not display labels. Selecting None also clears the Show time-axis label check box.

Bottom Displays Only

Display x-axis label on the bottom y-axis.

Dependency

Set Active display before setting this property. Activate this property by selecting Show time-axis label and setting Maximize axes to off.

Scope Configuration property: TimeAxisLabels.

Show time-axis label

Display or hide x-axis (time) labels.

Settings

Default: Clear for Scope block. Select for Time Scope block.

Select

Display x-axis label for the active display

Clear

Hide x-axis labels.

Dependency

Set Active display before setting this property. If you select this property and set the Time-axis labels is set to None, this property is deactivated.

Scope Configuration property: ShowTimeAxisLabel.

Active display

Display for setting display-specific properties, specified as a positive integer. The number of a display corresponds to its column-wise placement index.

Settings

Default: 1

Dependency

Setting this property selects the display for setting the properties Show Grid, Show legend, Title, Plot signals as magnitude and phase, Y-label, and Y-Limits.

Scope Configuration property: ActiveDisplay.

Title

Specify a title for display, specified as a character string. The default value %<SignalLabel> uses the input signal name for the title.

Settings

Default: %<SignalLabel>

Dependency

Set Active display before setting this property.

Scope Configuration property: Title.

Show legend

Show signal legend. The names listed in the legend are the signal names from the model. For signals with multiple channels, a channel index is appended after the signal name. See the Scope block reference for an example.

Settings

Default: Clear

Select

Display signal legend. Continuous signals have straight lines before their names and discrete signals have step-shaped lines.

Clear

Hide signal legend.

Dependency

Set Active Display before setting this property.

Scope Configuration property: ShowLegend.

Example

Connect a Sine Wave block to a Scope. Set the Amplitude parameter for the Sine Wave to [1 2]. Select the Legends check box for the Scope. Set the Signal name property for the signal to MySignal.

After simulating this model, the Scope window displays a sine wave for the two signal channels in MySignal, MySignal:1, and MySignal:2.

Edit the name of any channel in the legend by double-clicking the current name and entering a new channel name.

See also Signal Dimensionsand Determine Output Signal Dimensions.

Show grid

Show vertical and horizontal grid lines.

Settings

Default: Select

Select

Display grid lines.

Clear

Hide grid lines.

Dependency

Set Active Display before setting this property.

Scope Configuration property: ShowGrid.

Plot signals as magnitude and phase

Split display into magnitude and phase plots.

Settings

Default: Clear

Select

Display magnitude and phase plots. If the signal is real, plots the absolute value of the signal for the magnitude. The phase is 0 degrees for positive values and 180 degrees for negative values.

Clear

Display signal plot. If the signal is complex, plots the real and imaginary parts on the same y-axis.

Dependency

Set Active Display before setting this property.

Scope Configuration property: PlotAsMagnitudePhase.

Y-limits (Minimum)

Specify minimum value of y-axis, specified as real number.

Settings

Default: -10

Dependency

Set Active display before setting this property. Selecting Plot signals as magnitude and phase applies this property value to the magnitude plot. The y-axis limits of the phase plot are always [-180 180].

Scope Configuration property: YLimits.

Y-limits (Maximum)

Specify maximum value of y-axis, specified as real number.

Settings

Default: +10

Dependency

Set Active display before setting this property. Selecting Plot signals as magnitude and phase applies this property value to the magnitude plot. The y-axis limits of the phase plot are always [-180 180].

Scope Configuration property: YLimits.

Y-label

Specify y-axis label, specified as a character string.

Settings

Default: No label for Scope block. Amplitude for Time Scope block.

Dependency

Set Active display before setting this property. Selecting Plot signals as magnitude and phase hides this property and plots are labeled Magnitude and Phase.

Scope Configuration property: YLabel.

Limit data points to last

Specify to limit buffered data values before plotting and saving signals.

Settings

Default: Clear, 5000

Select

Save specified number of data values for each signal. If the signal is frame-based, the number of buffered data values is the specified number of data values multiplied by the frame size.

For simulations with Stop time set to inf, consider selecting Limit data points to last.

In some cases, for example where the sample time is small, selecting this parameter can have the effect of plotting signals for less than the entire time range of a simulation. If a scope plots a portion of your signals, consider increasing the number of data values to save.

Clear

Save and plot all data values. Clearing Limit data points to last can cause an out-of-memory error for simulations that generate a large amount of data or for systems without enough available memory.

Dependency

If this property is selected, also specify the number of data values by entering a positive integer in the text box. This property limits the data values a scope plots and the data values saved in the MATLAB® variable specified in Variable name. Data values are from the end of a simulation.

Scope Configuration properties: DataLoggingLimitDataPoints and DataLoggingMaxPoints.

Decimation

Reduce the amount of scope data to display and save.

Settings

Default: Clear, 2

Select

Plot and Log (save) scope data every Nth data point, where N is the decimation factor entered in the text box.

Clear

Save all scope data values.

Dependency

If this property is selected, also specify the decimation factor by entering a positive integer in the text box. The scope buffers every Nth data point, where N is the decimation factor you specify. A value of 1 buffers all data values. This property limits the data values a scope plots and the data values saved in the MATLAB variable specified in Variable name.

Log data to workspace

Activate saving scope data to a variable in the MATLAB workspace.

Settings

Default: Clear

Select

Activate logging and activate the Variable name, Save format, and Decimation properties. This property does not apply to floating scopes and scope viewers.

Clear

Inactivate logging and logging properties are unavailable.

Dependency

If this property is selected, also specify the properties Variable name and Save format.

Scope Configuration property: DataLogging.

Variable name

Specify a variable name for saving scope data in the MATLAB workspace, specified as a character string. This property does not apply to floating scopes and scope viewers.

Settings

Default: ScopeData

Dependency

Activate this property by selecting Log data to workspace.

Scope Configuration property: DataLoggingVariableName.

Save format

Select variable format for saving data to the MATLAB workspace. This property does not apply to floating scopes and scope viewers.

Settings

Default: Dataset

Dataset

Save data as a dataset object. This format does not support variable-size data, MAT-file logging, or external mode archiving. See Simulink.SimulationData.Dataset.

Structure With Time

Save data as a structure with associated time information.

Structure

Save data as a structure.

Array

Save data as an array with associated time information. This format does not support variable-size data.

Dependency

Activate this property by selecting Log data to workspace.

Scope Configuration property: DataLoggingSaveFormat.

Style Properties

Open the Style dialog box:

  • From the menu, select View > Style.

  • From the Configuration Properties button arrow. select the Style button .

Figure color

Select background color for display.

Plot type

Specify how to plot a signal.

Default: Auto for Scope block. Line for Time Scope block.

  • Line — Line graph.

  • Stairs — Stair-step graph.

  • Auto — Line graph if it is a continuous signal or a stair-step graph if it is a discrete signal.

Active display

Select active display for setting style properties.

Default: 1

Axes colors

Select the background color for axes (displays) with the first color pallet. Select the grid and label color with the second color pallet.

Properties for line

Select active line for setting line style properties.

Visible

Plot signal on active display.

Default: Select

Select

Plot signal.

Clear

Hide signal.

Line

Select line style, width, and color.

Marker

Select marker style.

Default: None

Characteristics

Data Types

Double | Single | Boolean | Base Integer | Fixed-Point | Enumerated

Multidimensional Signals

Yes

Variable-Size Signals

Yes

Code Generation

No

Introduced in R2015b

Was this topic helpful?