文档

Rocker Switch

在两个值之间切换参数

  • 图书馆:
  • 万博1manbetxSimulink /仪表板

描述

Rocker Switchblock toggles the value of the connected block parameter between two values during simulation. For example, you can connect theRocker Switch块到a转变块在如果在你的模型并更改其状态mulation. Use theRocker Switch使用其他仪表板块块,为您的模型创建交互式仪表板。

双击Rocker Switchblock does not open its dialog box during simulation and when the block is selected. To edit the block's parameters, you can use the物业检查员,或者您可以右键单击块并选择Block Parameters从上下文菜单。

笔记

仪表盘blocks cannot connect to variables until you update your model diagram. To connect Dashboard blocks to variables or modify variable values between opening your model and running a simulation, update your model diagram withCtrl+D

联系

仪表板块控件连接到变量和块参数。要将仪表板块连接到变量或参数,请在块参数中使用连接表。在联系表格,更新模型图Ctrl+D

  1. 双击块。

  2. Populate the联系通过在模型中选择感兴趣的块来表。

  3. Mark the button next to the parameter or variable you want to adjust during simulation.

  4. 点击申请

参数记录

连接到仪表板块的可调参数已记录到模拟数据检查器,您可以在其中查看参数值以及记录的信号数据。您可以访问MATLAB中的记录参数数据®workspace by exporting the parameter data from the Simulation Data Inspector UI or by using theSimulink.sdi.exportRunfunction. For more information about exporting data with the Simulation Data Inspector UI, see来自仿真数据检查器的导出数据。这parameter data is stored in aSimulink.SimulationData.Parameter对象,可作为导出的元素访问万博1manbetxsimulink.simulationdata.dataset

Limitations

  • 您无法将块连接或属性保存在使用的模型文件中MDL格式。

    要保存连接和属性,请将模型文件保存在slx格式。

  • 仪表板块只能连接到真实的标量信号。

  • 仪表板块无法连接到注释的块。

  • 仪表板块无法连接到参考模型中的信号。

  • 通过索引变量数组指定的参数未出现在联系桌子。For example, a block parameter defined using the variable引擎(1)没有出现在表中。

    访问参数联系表,将索引值分配给标量变量,例如engine_1。然后,使用标量变量定义块参数。

参数

展开全部

选择要使用的块参数联系桌子。要打开对话框,请双击块。然后,填充联系通过在模型中选择一个块来表。选择要控制的变量或参数,然后单击申请

笔记

要查看连接表中的工作区变量,请使用Ctrl+D

状态

标记顶部开关位置。您可以使用标签要显示交换参数在顶部定位时所采用的值,或者您可以输入文本标签。

例子:增益= 2

这value assigned to the connected parameter when the switch is positioned at the top.

标记底部开关位置。您可以使用标签要显示交换参数在底部定位时所采用的值,或者您可以输入文本标签。

例子:增益= 1

当开关位于底部时,分配给连接参数的值。

块标签的位置。当块连接到信号时,标签是连接信号的名称。当块未连接时,标签是教学文本。

Introduced in R2015a

Was this topic helpful?