创建 App 来控制仿真
使用 App 设计工具构建自定义 App 以与 Simulink 仿真进行交互。以交互方式配置您的 App 以实现以下目的:
使用专用 Simulink UI 组件执行常见任务,例如运行或暂停仿真或查看其进度。
通过将 UI 组件连接到模型中的变量,在仿真运行时调节模型变量。
通过将时间示波器 UI 组件连接到模型中的信号来可视化仿真结果。
要快速入门,请参阅Create App for Simulink Model。
函数
创建 UI 组件
uitimescope | Display time-domain signals in app (自 R2024a 起) |
uisimdatabutton | Create buttons to save or load simulation data in app (自 R2024a 起) |
uisimcontrols | Create simulation controls in app (自 R2024a 起) |
uisimprogress | Display simulation progress bar in app (自 R2024a 起) |
uisimvartuner | Create a model variable tuner UI component in an app (自 R2024a 起) |
将 UI 组件连接到模型元素
bind | Connect app components to simulation signals and variables (自 R2024a 起) |
findbindings | Find bindings between objects (自 R2024a 起) |
配置和控制仿真
配置仿真
setExternalInput | Specify external input data for top-level input ports using
SimulationInput or Simulation
object |
setInitialState | Specify initial state for simulation using
SimulationInput or Simulation
object |
setVariable | 使用 SimulationInput 或 Simulation 对象为仿真设置变量值 |
setModelParameter | Set model parameter values for simulation using
SimulationInput or Simulation
object |
setBlockParameter | Set block parameter values for simulation using
SimulationInput or Simulation
object |
控制仿真执行
initialize | Initialize simulation represented by Simulation
object (自 R2024a 起) |
start | Start simulation represented by Simulation object (自 R2024a 起) |
step | Advance simulation represented by Simulation object by specified
amount (自 R2024a 起) |
pause | Pause active simulation represented by Simulation
object (自 R2024a 起) |
resume | Continue paused simulation represented by Simulation
object (自 R2024a 起) |
stop | Stop simulation represented by Simulation object (自 R2024a 起) |
terminate | Terminate simulation represented by Simulation
object (自 R2024a 起) |
对象
将 UI 组件连接到模型元素
Binding | Connection between app components and simulation signals and variables (自 R2024a 起) |
配置和控制仿真
Simulation | Control simulation execution and tune variable, block parameter, and model parameter values (自 R2024a 起) |
属性
配置 UI 组件
TimeScope Properties | Control time scope UI component appearance and behavior (自 R2024a 起) |
LoadInputButton Properties | Control load input button UI component appearance and behavior (自 R2024a 起) |
SaveOutputButton Properties | Control save output button UI component appearance and behavior (自 R2024a 起) |
SimulationControls Properties | Manage simulation controls UI component appearance and behavior (自 R2024a 起) |
SimulationProgress Properties | Control simulation progress bar appearance and behavior (自 R2024a 起) |
VariableTuner Properties | Control variable tuner behavior and appearance (自 R2024a 起) |
主题
- Create App for Simulink Model
Step through the process of creating an app in App Designer that interfaces with a Simulink model.
- Connect UI Components to Simulink Model Elements
Connect UI components in App Designer to model variables and signals by creating bindings.
精选示例
Control a Simulink Simulation with App Designer
Create an interface to control a simulation for a Simulink® model. The app demonstrates connecting UI components to model elements by creating bindings and by writing callbacks to set model parameters.
Load and Save External Inputs for a Simulink Model with App Designer
An app that provides a user interface to load inputs for simulating a model, and then save the simulation output.
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)