如何以编程方式将 Simulink 求解器类型设置为固定步长
你可以使用 MATLAB 中的 set_param 函数以编程方式将 Simulink 模型的求解器类型设置为固定步长。以下是操作方法:
set_solver_type.m
set_param(gcs, 'SolverName', 'FixedStepAuto')gcs 代表 “get current system”,将返回当前加载的 Simulink 模型的名称。
你还可以根据需要指定 FixedStepDiscrete 或 FixedStepContinuous。例如:
set_solver_discrete.m
set_param(gcs, 'SolverName', 'FixedStepDiscrete')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