简体   繁体   English

调用 Simulink 模型时的 Matlab 脚本“采样时间段”错误

[英]Matlab script "sample time period" error when calling Simulink model

I am writing a Matlab script to call my Simulink model :我正在编写一个 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)

But I get the following error:但我收到以下错误:

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.

Does anyone know how to solve it?有谁知道如何解决它? I tried adding the line T_s= int64(T_s) But I have the same issue...我尝试添加行T_s= int64(T_s)但我有同样的问题......

Does anybody know how to solve this?有谁知道如何解决这个问题?

Thank you !谢谢 !

Someone answered it for me!有人为我解答!

Because 'test_lau/INES0' this block sample time (0.01) is lower than model sample time.因为“test_lau/INES0”这个块采样时间(0.01)低于模型采样时间。 It sould be multiple of the fixed step size (0.1) specified for model.它应该是为模型指定的固定步长 (0.1) 的倍数。 there are 2 options 1)set model sample time as 0.01 2)set 'test_lau/INES0' sample time as inherit ot 0.1有 2 个选项 1)将模型采样时间设置为 0.01 2)将“test_lau/INES0”采样时间设置为继承 0.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM