如何以编程方式设置 Simulink 的开始时间/停止时间
你可以使用 MATLAB 中的 set_param 函数以编程方式设置 Simulink 模型的开始时间和停止时间。以下是操作方法:
set_simulink_time.m
set_param(gcs, 'StartTime', '1.5')
set_param(gcs, 'StopTime', 'inf')此代码将当前选定的 Simulink 模型的开始时间设置为 1.5 秒,停止时间设置为无穷大(gcs 代表 “get current system”,将返回当前加载的 Simulink 模型的名称)。
Check out similar posts by category:
Matlab/Simulink
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow