Documentation Center

  • Trial Software
  • Product Updates

Scope Signal Viewer Characteristics

Scope Signal Viewer Toolbar

The signal viewer toolbar is attached to each scope signal viewer. It has the following controls.

IconFunction

Opens the Print dialog box so you can print the contents of a Scope Viewer window.

Opens the Scope parameters dialog for modifying display characteristics. For details, see Scope Signal Viewer Parameters Dialog Box.

Simultaneously zooms in on the x and y axes. The zoom feature is not active while the simulation is running.

Use this button to zoom in on the x axis only. The zoom feature is not active while the simulation is running.

Use this button to zoom in on the y axis only. The zoom feature is not active while the simulation is running.

Automatically scales the axis to fully display all signals.

Stores the current axis settings so you can apply them to the next simulation.

Restores the graph setting values saved by the most recent Save axes settings command.

Activates the Signal Selector. For more information, see Signal Selector.

Docks and undocks the Scope Viewer. When you dock the Scope Viewer, it is placed within the MATLAB® Command Window and automatically resized.

Scope Signal Viewer Context Menu

The scope signal viewer context menu is a convenient way to make simple changes to a viewer without navigating to a Scope or Floating Scope parameters dialog box.

Within a Scope signal viewer window, right-click to display the context menu. It contains the following controls.

ControlFunction
Legends

Adds a legend to your scope viewer.

Autoscale

Automatically scales the viewer axis.

Signal selection

Displays the Signal Selector dialog.

For information, see Signal Selector

Axes properties

Displays the Axis Properties dialog.

You can manually set the minimum and maximum range for the y axis here.

Scope parameters

Displays the Scope parameters dialog.

For information, see Scope Signal Viewer Parameters Dialog Box.

Tick labels

Displays the Tick Labels dialog.

From here you can turn on and off various tick options.

Scope Signal Viewer Parameters Dialog Box

To open a Scope or Floating Scope parameters dialog box,

  • On the scope toolbar, click

There are three tabs on the dialog box:

  • General — set the axis characteristics and the sampling decimation value

  • History — control the amount of stored and displayed data

  • Performance — control the scope refresh rate.

General Tab

With this tab you control the number of axes, the time range, and the appearance of your graph.

Number of axes.  Set the number of axes in this data field. Each axis is displayed as a separate graph within a single Scope Viewer.

An example of this is shown in Adding Signals to a Signal Viewer.

Time Range.  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.

    Note:   Do not enter variable names in these fields.

Tick labels.  Specifies whether to label axes ticks. The options are:

OptionEffect

all

Places ticks on the outside of all axes

inside

Places tick labels inside all axes (available only on signal viewers)

bottom axis only

Places tick labels outside the bottom axes

Scroll.  When you select this option, the scope continuously scrolls the displayed signals to the left to keep as much data in view as will fit on the screen at any one time.

In contrast, when this option is not selected, the scope draws a screen full of data from left to right until the screen is full, erases the screen, and draws the next screen full of data. This loop is repeated until the end of simulation time. The effects of this option are discernible only when drawing is slow, for example, when the model is very large or has a very small step size.

Data markers.  Displays a marker at each data point on the Scope Viewer screen.

Legends.  Displays a legend on the scope that indicates the line style used to display each signal.

Decimation.  Logs every Nth data point, where N is the number entered in the edit field.

For example, suppose that the input signal to your Scope block has a fixed sample time of 0.1 s. If you enter a value of 2, data points for this viewer will be recorded at times 0.0, 0.2, 0.4....

History Tab

With this tab you control the amount of data that the Scope signal viewer stores, displays and stores to the workspace. The values that appear in these fields are the values that are used in the next simulation.

Limit data points to last.  Limits the number of data points saved to the workspace. Select the Limit data points to last check box and enter 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.

Save to model signal logging object.  At the end of the simulation, this option saves the data displayed on the Scope Viewer . The data is saved in the Simulink.ModelDataLogs object used to log data for the model (see Export Signal Data Using Signal Logging for more information).

For this option to take effect, you must also enable signal logging for the model as a whole. To do this, check the Signal logging option on the Data Import/Export pane of the Model Configuration Parameters dialog box.

For new models, use the Dataset logging format. If you use the Dataset format for signal logging, then Simulink® does not log the signals configured to be logged in the Signal Viewer. Explicitly mark the signal for signal logging by using the Signal Properties dialog box. To access the Signal Properties dialog box, right-click a signal and from the context menu, select Properties.

Logging Name.  Specifies the name under which to store the viewer's data in the model's Simulink.ModelDataLogs object. The name must be different from the log names specified by other signal viewers or for other signals, subsystems, or model references logged in the model's Simulink.ModelDataLogs object.

Performance Tab

Controls how frequently the Scope signal viewer is refreshed. Reducing the refresh rate can speed up the simulation in some cases.

This tab contains the following controls.

Refresh Period.  Select the units in which the refresh period is expressed. Options are either seconds or frames, where a frame is the width of the scope's screen in seconds. This is the value of the scope's Time range parameter.

Refresh Slider.  Sets the refresh rate.

Drag the slider button to the right to increase the refresh period and hence decrease the refresh rate.

Freeze Button.  Controls refresh.

Click the button to freeze (stop refreshing) or unfreeze the Scope Viewer.

Line Styles with Scope Signal Viewer

If a signal contains multiple elements such as a vector or matrix, the viewer distinguishes the elements with different line styles. If a signal has more than four elements, the viewer cycles through the line styles. The line styles retain the color of the signal.

Signal ElementScope Viewer
1

2

3

4

Parameter Settings and Performance with Scope Signal Viewer

In some cases, when a Scope signal viewer needs to display a large number of data points, the simulation slows down. When this happens, you can improve simulation performance by adjusting the settings of some of the viewer parameters. Try one or a combination of the following until you are satisfied with the simulation performance.

  • Turn off scroll mode.

  • Reduce the time range.

  • Use decimation to reduce the number of data points.

  • Increase the refresh period to decrease the refresh rate.

  • Limit the number of data points that the viewer saves to the workspace.

Was this topic helpful?