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
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.
Use the Signal Selector to connect signals to a Floating Scope block or Scope viewer.
Open a Scope window. In a Simulink model, double-click a Floating Scope block or Scope viewer icon .
Open the Signal Selector. On the Scope window toolbar, click the Signal Selector button .
For Scopes with multiple displays, select a display. In the Signal Selector dialog box, select a display from the Select signals for object drop-down list.
Select check boxes for the signals you want to view.
Click Close and then run a simulation.
This procedure uses the model vdp to demonstrate saving signals to the MATLAB® Workspace.
Connect signals using the Signal Selector. See Connect Signals to Floating Scope Block or Scope Viewer. For example, select the
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. From the Simulink Editor menu, select Simulation > Model Configuration Parameters > Data Import/Export.
Select the Signal logging check
box. Use the default Dataset object name
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 signal.
In the MATLAB Command Window, enter these commands
to view the logged data from
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 to unlock the Floating Scope.
Signals that you connected to this scope using the Signal Selector are removed.
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.
Run a simulation.
Right-click a signal line.
Select Create & Connect Viewer > Simulink > Scope.
The selected signal connects to the Scope Viewer, and a viewer symbol is added to the signal line.
Connect additional signals using the Signal Selector.