| Contents | Index |
| On this page… |
|---|
Adding Signals to a Signal Viewer |
Signal viewers are not the same as Scope blocks. For an explanation of the differences, see Scope Block and Scope Signal Viewer Differences.
Signal viewers do not show signal labels on the axis
Signal viewers do not work with Report Generator
Signal viewers do not display the simulation minor time step values
Not all signal viewer features are supported when you simulate your model in Rapid Accelerator mode. For more information, see Behavior of Scopes and Viewers with Rapid Accelerator Mode.
The Help button for a signal viewer is located on the parameters dialog box for a specific viewer type. For more information, seeScope Signal Viewer Parameters Dialog Box .
If you want to,
Quickly connect or disconnect a scope signal viewer, use the context menu.
Review all of the signal viewers and the signals connected to them, use the Signal and Scope Manager.
To attach a signal viewer with the signal content menu,
On your Simulink block diagram, right-click a signal, and then from the context menu, select Create & Connect Viewer.
From the list that appears, select the type of signal viewer you want to attach.
If you attach a scope signal viewer, a viewer window opens. You must run the simulation after you attach the viewer for the information to be plotted.
To attach a scope signal viewer using the Scope & Signal Manager,
On your Simulink block diagram, right-click a signal, and then from the context menu, select Signal & Scope Manager. The Signal & Scope Manager dialog box opens.
In the Types pane and under the Viewers node, expand a product node to show the viewers installed and available to you.

Note The Simulink Scope displayed in the Signal and Scope Manager Types pane is not the same as the Simulink Scope Block. For an explanation of the differences, see Scope Block and Scope Signal Viewer Differences. |
Under an expanded product node, select a viewer, and then click the Attach to model button.

The viewer is added to a table in the Viewers tab in the Generators/Viewers in model pane. The table lists the viewers in your model.

Each row corresponds to a viewer. The columns specify each viewer name, type, and number of inputs. If a viewer accepts a variable number of inputs, the # in entry for the viewer contains a pull-down list that displays the range of inputs that the viewer can accept. To change the number of inputs accepted by the viewer, select a value from the pull-down list.
To add additional traces to an existing signal viewer,
In your block diagram, right-click a signal.
From the signal context menu, select Connect to existing viewer.
A list of signal viewers that were added to your model is displayed.
From the list, select the signal viewer to attach the signal.
You can also add signals to signal viewers with the Signal and Scope Manager. See Signal and Scope Manager.
Note If you add or remove signals from a Signal Viewer, the Signal Viewer title and legends update only when you run a simulation, and then open the viewer. |
Right-click a signal viewer icon. From the context menu, point to Open Viewer and then select a viewer from the list.
![]()
Depending on the type of signal viewer, the following happens:
Scope and Floating Scope — A Viewer: Scope window opens with a graph of the signals attached to the viewer.
XY Graph — A Sink Block Parameters dialog box opens. After running a simulation, a Viewer: XY Graph window opens with a graph of the X and Y signals attached to the viewer.
Customize the signal viewer to better visualize the simulation results.
To zoom in on a region (simultaneously zooming in
on the x and y directions),
select
from the Scope Viewer toolbar, and
left-click within the graph. While holding down the mouse button,
define the region of interest.
To zoom, click and hold the left mouse button, and drag the mouse to define the zoom region bounding box. Release the mouse button to effect the change.
Select
and use the mouse to
zoom only in the x direction.
Define the zoom region by positioning the pointer at one end of the region, pressing and holding down the left mouse button, then moving the pointer to the other end of the region. Release the mouse button to effect the change. To zoom, click and hold the left mouse button, and drag the mouse to define the zoom region bounding box. Release the mouse button to effect the change.
Select
and use the mouse to
zoom only the y direction.
To save the data displayed on the viewer to the MATLAB workspace, perform the following steps:
In the Viewer toolbar, click the properties icon
.
Click the History tab.
Select Save to model signal logging object (logsout).
In the Logging name field, enter a logging variable name.
Assign a name to the signal in the block diagram, for example, x1.
Run the simulation by selecting Simulation > Start.
You can now view the data in the MATLAB Command Window by entering the following commands:
logsout.unpack('all')
data = x1.Data
x1.time
where x1 is the name of the signal.
You can plot the data interactively or programmatically.
Simulation Data Inspector — plot the data as explained in Inspecting and Comparing Logged Signal Data.
Simplot — plot the data from the command line using the simplot command (see simplot). The resulting figure looks identical to the viewer window and can be annotated using the Plot Editing Tools.
![]() | About Scope Blocks, Signal Viewers, Signal Logging, and Test Points | Scope Signal Viewer Tasks | ![]() |

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