Documentation

Floating Scope and Scope Viewer Tasks

Add Floating Scope Block to Model

To add aFloating Scopeblock from the Simulink®block library:

  1. 在Simulink万博1manbetx编辑器菜单中,单击库浏览器按钮

  2. 从Simulink万博1manbetx汇库中,拖动浮动的副本Scopeblock to the Simulink Editor.

To add aFloating Scope通过从模型图中搜索块:

  1. 在Simuli万博1manbetxnk编辑器中,单击模型图,然后开始键入浮动范围

  2. From the list, selectFloating Scope Simulink/Sinks

Add Scope Viewer with Signal & Scope Manager

  1. 在Simulink万博1manbetx编辑菜单中,选择Diagram>Signals & Ports>Signal & Scope Manager

  2. In the Signal & Scope Manager, in theTypespane and under theViewersnode, expand a product node to show the available viewers.

  3. 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.

  1. Open a Scope window. In a Simulink model, double-click a Floating Scope block or Scope viewer icon

  2. 打开信号选择器。在Scope window toolbar, click the Signal Selector button

  3. For Scopes with multiple displays, select a display. In the Signal Selector dialog box, select a display from the选择对象的信号drop-down list.

  4. Select check boxes for the signals you want to view.

  5. ClickClose和then run a simulation.

Save Simulation Data Using Floating Scope Block

This procedure uses the modelvdp向MATLAB演示保存信号®工作区。

  1. 在模型中添加浮动示波器或示波​​器查看器。看Add Floating Scope Block to Model或者Add Scope Viewer with Signal & Scope Manager

  2. 使用信号选择器连接信号。看Connect Signals to Floating Scope Block or Scope Viewer。例如,选择信号x1x2

  3. 打开浮动示波器或范围查看器窗口。从工具栏中,单击“参数”按钮

  4. 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 symbolson the signals.

  5. Open theConfiguration Parametersdialog box. From the Simulink Editor menu, select模拟>模型配置参数>数据导入/导出

  6. Select theSignal loggingcheck box. Use the default Dataset object namelogsout或者enter your own name. Click好的

  7. 运行模拟。Simulink saves data to the MATLAB Workspace in a Dataset object with two elements, one element for each signal.

  8. 在MATLAB命令窗口中,输入这些命令以查看从logsout, wherex1is 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

  1. From a Simulink model, double-click a Floating Scope block.

  2. From the toolbar, click theRunbutton

For information on using toolbar buttons to control a simulation, seeStep Through a Simulation

Delete Scope Viewer

  1. Right-click any signal line with a viewer attached or click the viewer symbolattached to a signal line.

  2. Select删除查看器,然后选择一个查看器名称。

View Signals on a Floating Scope Quickly

  1. 打开浮动范围窗口。

  2. 在toolbar, click the Lock buttonto unlockthe Floating Scope.

    Signals that you connected to this scope using the Signal Selector are removed.

  3. 在model, click a signal line to select and highlight the signal line. To select multiple signals, hold down theShiftkey while selecting signals.

  4. 运行模拟。

Connect Scope Viewers Without Using Signal Selector

  1. Right-click a signal line.

  2. Select创建并连接查看器>万博1manbetx>Scope

    The selected signal connects to the Scope Viewer, and a viewer symbol被添加到信号线中。

Connect additional signals using the Signal Selector.

看Also

||

相关话题

这个话题有帮助吗?