| Contents | Index |
| On this page… |
|---|
Comparison of Blocks for Plotting Signals Against Time Inserting and Connecting Scope Blocks Connections Among Points in Plots |
The table below indicates the kinds of data you can plot using various combinations of blocks and parameter values. To view or set the parameters, open the dialog box using the Parameters toolbar button in the plot window.
| Data | Block | Parameter |
|---|---|---|
| Scalar signal vs. time | Signal Scope | X value from = Event time |
| Scalar signal vs. time | Scope | |
| Scalar signal values without regard to time | Signal Scope | X value from = Index |
| Two scalar signals (X-Y plot) | X-Y Signal Scope | |
| Attribute vs. time | Attribute Scope | X value from = Event time |
| Attribute values without regard to time | Attribute Scope | X value from = Index |
| Two attributes of same entity (X-Y plot) | X-Y Attribute Scope | |
| Attribute vs. scalar signal | Get Attribute block to assign the attribute value to a signal; followed by X-Y Signal Scope | |
| Scalar signal vs. attribute | ||
| Number of entity arrivals per time instant | Instantaneous Entity Counting Scope | |
| Number of events per time instant | Instantaneous Event Counting Scope |
The following table compares the capabilities of two blocks for plotting an event-based signal against time.
| Capability | Signal Scope Block (SimEvents Sinks library) | Scope Block (Simulink Sinks library) |
|---|---|---|
| Includes markers to show sample time hits | Yes | No |
| Creates stair plots | Yes (default plot) | Yes |
| Creates stem plots | Yes (alternative to stair plot) | No |
| Creates continuous plots | Yes (alternative to stair plot) | No |
| Plots nonscalar signals | No | Yes |
| Plots multiple signals per window | No | Yes |
| Supports event-based signals | Yes | Yes |
| Supports time-based signals | No | Yes |
| Supports data types other than double | No | Yes |
| Available as a viewer | No | Yes |
Markers in the Signal Scope plot are especially useful when your event-based signal:
Assumes zero-duration values
Assumes the same value in consecutive sample time hits at different times
The following plots of the same event-based signal illustrate the additional information that markers provide.
Signal Scope Plot with Markers

Scope Plot Without Markers

The following table indicates the number, kind, and meaning of the input ports on each scope block.
| Block | Input Ports | Port Description |
|---|---|---|
| Signal Scope | One signal input port | Signal representing the data to plot |
| Scope | One signal input port | Signal representing the data to plot |
| X-Y Signal Scope | Two signal input ports | Signals representing the data to plot |
| Attribute Scope | One entity input port | Entities containing the attribute value to plot |
| X-Y Attribute Scope | One entity input port | Entities containing the attribute values to plot |
| Instantaneous Entity Counting Scope | One entity input port | Entities whose arrivals the block counts |
| Instantaneous Event Counting Scope | One signal input port | Signal whose signal-based events or function calls the block counts |
The following figure shows some typical arrangements of scope blocks in a model. Notice that the blocks that have entity input ports can have optional entity output ports, and that signal lines can branch whereas entity connection lines cannot.

You can configure certain scope blocks in the SimEvents Sinks library to determine whether and how the block connects the points that it plots. The following table indicates the options. To view or change the parameter settings, open the dialog box using the Parameters toolbar button in the plot window.
| Connection Characteristics | Setting | Sample Plot |
|---|---|---|
| Stairstep across, then up or down. Also known as a zero-order hold. | Plot type = Stair in the block dialog box |
![]() |
| Vertical line from horizontal axis to point. No connection with previous or next plotted point. Also known as a stem plot. | Plot type = Stem in the block dialog box |
![]() |
| Line segment from point to point. Also known as a first-order hold. | Plot type = Continuous in the block dialog box |
![]() |
| No connection with other points or with axis. Also known as a scatter plot. | Style > Line > None in the plot window |
![]() |
Note If no initial output, data value, or arriving entity indicates a value to plot at T=0, the plot shows no point at T=0. In this case, the plot does not connect the first plotted point to the T=0 edge of the plot. |
Using parameters on the Axes tab of the dialog box of scope blocks in the SimEvents Sinks library, you set the initial limits for the axes of the plot. Also, these parameters let you choose how the block responds when a point does not fit within the current axis limits:
If X value is beyond limit
If Y value is beyond limit
Choices for the parameters are in the table.
| Option | Description |
|---|---|
| Stretch axis limits | Maintain one limit while doubling the size of the displayed interval (without changing the size of the containing plot window) |
| Keep axis limits unchanged | Maintain both limits, which means that points outside the limits do not appear |
| Shift axis limits | Maintain the size of the displayed interval while changing both limits |
Other operations can still affect axis limits, such as the autoscale, zoom, and pan features.
To store the current limits of both axes for the next simulation, select Axes > Save axes limits from the plot window menu.
The Data History tab of the dialog box of scope blocks in the SimEvents Sinks library lets you balance data visibility with simulation efficiency. Parameters on the Data History tab determine how much data the blocks cache during the simulation. Caching data lets you view it later, even if the scope is not open during the simulation. Caching less or no data accelerates the simulation and uses less memory.
If you set the Store data when scope is closed parameter to Limited, uncached data points disappear when:
The simulation ends
You interact with the plot after pausing the simulation (using Simulation > Pause, for example)
The following examples use scope blocks to create different kinds of plots:
| Example | Description |
|---|---|
| Plotting the Queue-Length Signal and Observations from Plots | Stairstep and continuous plots of statistical signals |
| Example: Round-Robin Approach to Choosing Inputs | Stem plot of data from an attribute |
| Example: Preemption by High-Priority Entities | Unconnected plot of a signal using dots |
| Example: Setting Attributes | Stairstep plots of data from attributes using Attribute Scope blocks as sinks |
| Example: Synchronizing Service Start Times with the Clock | Stem plots that count entities using Instantaneous Entity Counting Scope blocks with entity output ports |
| X-Y Signal Scope reference page | Continuous plot of two signals |
| X-Y Attribute Scope reference page | Unconnected plot of two attributes using x's as plotting markers |
![]() | Plotting Data | Working with Scope Plots | ![]() |

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |