【问题标题】:Matlab script "sample time period" error when calling Simulink model调用 Simulink 模型时的 Matlab 脚本“采样时间段”错误
【发布时间】:2021-10-15 21:58:26
【问题描述】:

我正在编写一个 Matlab 脚本来调用我的 Simulink 模型:

Constant10=43;
Constant11=43;
In1=[1,2,3];
In2=[4,5,6];
t_stop = 100;
T_s = t_stop/1000;
options = simset('solver', 'ode5', 'fixedstep', T_s);
sim('test_lau.slx',t_stop,options)

但我收到以下错误:

Error using test_call_model (line 18)
The sample time period (0.01) of 'test_lau/INES0' is not an integer multiple of the fixed step size (0.1) specified for model.

有人知道怎么解决吗?我尝试添加该行 T_s= int64(T_s) 但我也有同样的问题...

有人知道怎么解决吗?

谢谢!

【问题讨论】:

    标签: matlab simulink


    【解决方案1】:

    有人帮我回答了!

    因为 'test_lau/INES0' 这个块采样时间 (0.01) 低于模型采样时间。 它应该是为模型指定的固定步长 (0.1) 的倍数。 有2个选项 1)设置模型采样时间为0.01 2) 将“test_lau/INES0”采样时间设置为继承 ot 0.1

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-07
      • 1970-01-01
      • 2014-09-17
      • 2017-11-08
      相关资源
      最近更新 更多