Main Content

创建 App 来控制仿真

使用 App 设计工具以交互方式构建与 Simulink® 仿真交互的自定义 App

使用 App 设计工具构建自定义 App 以与 Simulink 仿真进行交互。以交互方式配置您的 App 以实现以下目的:

  • 使用专用 Simulink UI 组件执行常见任务,例如运行或暂停仿真或查看其进度。

  • 通过将 UI 组件连接到模型中的变量,在仿真运行时调节模型变量。

  • 通过将时间示波器 UI 组件连接到模型中的信号来可视化仿真结果。

要快速入门,请参阅Create App for Simulink Model

函数

全部展开

uitimescopeDisplay time-domain signals in app (自 R2024a 起)
uisimdatabuttonCreate buttons to save or load simulation data in app (自 R2024a 起)
uisimcontrolsCreate simulation controls in app (自 R2024a 起)
uisimprogressDisplay simulation progress bar in app (自 R2024a 起)
uisimvartunerCreate a model variable tuner UI component in an app (自 R2024a 起)
bindConnect app components to simulation signals and variables (自 R2024a 起)
findbindingsFind bindings between objects (自 R2024a 起)

配置仿真

setExternalInputSpecify external input data for top-level input ports using SimulationInput or Simulation object
setInitialStateSpecify initial state for simulation using SimulationInput or Simulation object
setVariable使用 SimulationInputSimulation 对象为仿真设置变量值
setModelParameterSet model parameter values for simulation using SimulationInput or Simulation object
setBlockParameterSet block parameter values for simulation using SimulationInput or Simulation object

控制仿真执行

initializeInitialize simulation represented by Simulation object (自 R2024a 起)
startStart simulation represented by Simulation object (自 R2024a 起)
stepAdvance simulation represented by Simulation object by specified amount (自 R2024a 起)
pausePause active simulation represented by Simulation object (自 R2024a 起)
resumeContinue paused simulation represented by Simulation object (自 R2024a 起)
stopStop simulation represented by Simulation object (自 R2024a 起)
terminateTerminate simulation represented by Simulation object (自 R2024a 起)

对象

全部展开

BindingConnection between app components and simulation signals and variables (自 R2024a 起)
SimulationControl simulation execution and tune variable, block parameter, and model parameter values (自 R2024a 起)

属性

全部展开

TimeScope PropertiesControl time scope UI component appearance and behavior (自 R2024a 起)
LoadInputButton PropertiesControl load input button UI component appearance and behavior (自 R2024a 起)
SaveOutputButton PropertiesControl save output button UI component appearance and behavior (自 R2024a 起)
SimulationControls PropertiesManage simulation controls UI component appearance and behavior (自 R2024a 起)
SimulationProgress PropertiesControl simulation progress bar appearance and behavior (自 R2024a 起)
VariableTuner PropertiesControl variable tuner behavior and appearance (自 R2024a 起)

主题