To add a Floating Scope block from the Simulink® block library:
From the Simulink Editor menu, click the Library Browser button .
From the Simulink Sinks library, drag a copy of the Floating Scope block to the Simulink Editor.
To add a Floating Scope block by searching from the model diagram:
In the Simulink Editor, click the model diagram, and then start typing
From the list, select
Floating Scope Simulink/Sinks.
From the Simulink Editor menu, select Diagram > Signals & Ports > Signal & Scope Manager.
In the Signal & Scope Manager, in the Types pane and under the Viewers node, expand a product node to show the available viewers.
Select a Scope, and then click Attach to model. The viewer is added to a table on the Viewers tab in the Generators/Viewers in model pane.
Connect signals to a Floating Scope block or Scope viewer.
Open the scope by double-clicking a Floating Scope block or Scope viewer icon .
In the scope window toolbar, click the signal selection button . You may need to select the lock dropdown to see the button.
The Simulink canvas grays, indicating you can interactively select signals to connect to the scope.
Select the signals you want to connect to the scope. For multiple signals, click and drag multiple signals.
In the Connect pop-up, select the check box next to the signals you want to connect.
For scopes with multiple displays, select a display from the drop-down and connect the signals.
Click the X in the upper-right of the Simulink canvas and then run a simulation.
This procedure uses the model vdp to demonstrate saving signals to the MATLAB® Workspace.
Connect signals to the scope, see Connect Signals to Floating Scope Block or Scope Viewer. For example, select the signals
Open a Floating Scope or Scope Viewer window. From the toolbar, click the Parameters button .
Click the Logging tab, and then select the Log/Unlog Viewed Signals to Workspace button.
This selection also sets the Log signal data parameter check box for the connected signals. The Simulink Editor places logging symbols on the signals.
Open the Configuration Parameters dialog box by selecting Simulation > Model Configuration Parameters. In the Configuration Parameters, select Data Import/Export.
Select the Signal logging check box. Use the default Dataset object name
logsout or enter your own name. Click OK.
Run a simulation. Simulink saves data to the MATLAB Workspace in a
Dataset object with two elements, one element for each
In the MATLAB Command Window, enter these commands to view the logged data from
x1 is the name of a signal:
x1_data = logsout.get('x1').Values.Data x1_time = logsout.get('x1').Values.Time plot(x1_time,x1_data)
From a Simulink model, double-click a Floating Scope block.
From the toolbar, click the Run button .
For information on using toolbar buttons to control a simulation, see Step Through a Simulation.
Right-click any signal line with a viewer attached or click the viewer symbol attached to a signal line.
Select Delete Viewer, and then select a viewer name.
Open a Floating Scope window.
On the toolbar, click the Lock button so that the icon is unlocked .
On the model, click a signal line to select and highlight the signal line. To select multiple signals, hold down the Shift key while selecting signals.
After clicking on the canvas, the selected display clears any previous signal connections.
Run a simulation. As long as the unlock icon is showing, you can click between signals to switch which signal appears in the Floating Scope.