Floating Scope and Scope Viewer Tasks
Add Floating Scope Block to Model
To add aFloating Scopeblock from the Simulink®block library:
在Simulink万博1manbetx编辑器菜单中,单击库浏览器按钮
。
从Simulink万博1manbetx汇库中,拖动浮动的副本Scopeblock to the Simulink Editor.
To add aFloating Scope通过从模型图中搜索块:
在Simuli万博1manbetxnk编辑器中,单击模型图,然后开始键入
浮动范围
。From the list, select
Floating Scope Simulink/Sinks
。
Add Scope Viewer with Signal & Scope Manager
在Simulink万博1manbetx编辑菜单中,选择Diagram>Signals & Ports>Signal & Scope Manager。
In the Signal & Scope Manager, in theTypespane and under theViewersnode, expand a product node to show the available viewers.
Select aScope,然后单击Attach to model。The viewer is added to a table on theViewerstab in theGenerators/Viewers in model窗格。
Connect Signals to Floating Scope Block or Scope Viewer
使用信号选择器将信号连接到Floating Scopeblock or Scope viewer.
Open a Scope window. In a Simulink model, double-click a Floating Scope block or Scope viewer icon
。
打开信号选择器。在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选择对象的信号drop-down list.
Select check boxes for the signals you want to view.
ClickClose和then run a simulation.
Save Simulation Data Using Floating Scope Block
This procedure uses the modelvdp向MATLAB演示保存信号®工作区。
在模型中添加浮动示波器或示波器查看器。看Add Floating Scope Block to Model或者Add Scope Viewer with Signal & Scope Manager。
使用信号选择器连接信号。看Connect Signals to Floating Scope Block or Scope Viewer。例如,选择信号
x1
和x2
。打开浮动示波器或范围查看器窗口。从工具栏中,单击“参数”按钮
。
Click theLoggingtab, and then select theLog/Unlog Viewed Signals to Workspacebutton.
This selection also sets theLog signal dataparameter check box for the connected signals. The Simulink Editor places logging symbols
on the signals.
Open theConfiguration Parametersdialog box. From the Simulink Editor menu, select模拟>模型配置参数>数据导入/导出。
Select theSignal loggingcheck box. Use the default Dataset object name
logsout
或者enter your own name. Click好的。运行模拟。Simulink saves data to the MATLAB Workspace in a Dataset object with two elements, one element for each signal.
在MATLAB命令窗口中,输入这些命令以查看从
logsout
, wherex1
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)
Run Simulation from Floating Scope Window
From a Simulink model, double-click a Floating Scope block.
From the toolbar, click theRunbutton
。
For information on using toolbar buttons to control a simulation, seeStep Through a Simulation。
Delete Scope Viewer
Right-click any signal line with a viewer attached or click the viewer symbol
attached to a signal line.
Select删除查看器,然后选择一个查看器名称。
View Signals on a Floating Scope Quickly
打开浮动范围窗口。
在toolbar, click the Lock button
to unlock
the Floating Scope.
Signals that you connected to this scope using the Signal Selector are removed.
在model, click a signal line to select and highlight the signal line. To select multiple signals, hold down theShiftkey while selecting signals.
运行模拟。
Connect Scope Viewers Without Using Signal Selector
Right-click a signal line.
Select创建并连接查看器>万博1manbetx>Scope。
The selected signal connects to the Scope Viewer, and a viewer symbol
被添加到信号线中。
Connect additional signals using the Signal Selector.