|On this page…|
The signal viewer toolbar is attached to each scope signal viewer. It has the following controls.
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.
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.
Adds a legend to your scope viewer.
Automatically scales the viewer axis.
Displays the Signal Selector dialog.
For information, see Signal Selector
Displays the Axis Properties dialog.
You can manually set the minimum and maximum range for the y axis here.
Displays the Scope parameters dialog.
For information, see Scope Signal Viewer Parameters Dialog Box.
Displays the Tick Labels dialog.
From here you can turn on and off various tick options.
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.
With this tab you control the number of axes, the time range, and the appearance of your graph.
An example of this is shown in Adding Signals to a Signal Viewer.
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.
Places ticks on the outside of all axes
Places tick labels inside all axes (available only on signal viewers)
bottom axis only
Places tick labels outside the bottom axes
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.
Note: In some cases, the simulation slows when the simulation runs with the scroll option selected. See Parameter Settings and Performance with Scope Signal Viewer.
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....
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.
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.
Controls how frequently the Scope signal viewer is refreshed. Reducing the refresh rate can speed up the simulation in some cases.
Note: For information about additional scope signal viewer parameters that can affect performance, see Parameter Settings and Performance with Scope Signal Viewer.
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.
Drag the slider button to the right to increase the refresh period and hence decrease the refresh rate.
Click the button to freeze (stop refreshing) or unfreeze the Scope 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 Element||Scope 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.