首页 > 解决方案 > 声明 Simulink 模型变量的 Matlab 脚本

问题描述

我得到了以下受保护的 Simulink 模型: Simulink 模型

它手动工作(我在 Simulink GUI 上单击“运行”,它给了我三个输出)。我正在使用 Matlab SIMSET 工具编写脚本来定义必要的变量并调用此模型以运行它:

Constant=43;
Constant1=43;
Constant2=43;
Constant7=43;
Constant10=43;
Constant11=43;

t_stop = 100;
T_s = t_stop/1000;
options = simset('solver', 'ode5', 'fixedstep', T_s);
sim('test_lau.slx',t_stop,options)

我知道接口“EC”和“UL”每个都输入一个向量,但是即使我在脚本中定义了两个向量,如何将它们分配给“EC”和“UL”?

预先感谢您的帮助!

标签: matlabsimulinksimulink-library

解决方案


推荐阅读