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。
双击块。
Populate the联系通过在模型中选择感兴趣的块来表。
Mark the button next to the parameter or variable you want to adjust during simulation.
点击申请。
参数记录
连接到仪表板块的可调参数已记录到模拟数据检查器,您可以在其中查看参数值以及记录的信号数据。您可以访问MATLAB中的记录参数数据®workspace by exporting the parameter data from the Simulation Data Inspector UI or by using theSimulink.sdi.exportRun
function. 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
。然后,使用标量变量定义块参数。