解决Simulink输入输出出现variable-size mode 和fixed size model的问题

使用simulink封装了好多个子系统,这时候可能出现如下报错:“Simulink cannot propagate the variable-size mode from the input "。。。" to the input port 1 of ‘。。。’. This input port expects a fixed-size mode. The variable-size mode originates from ‘。。。 '.
笔者有出现这个问题,上网搜了后找到些貌似靠谱的答案,但是还未能解决问题。这些答案或许能解决你的问题,网址贴在这里:http://cn.mathworks.com/matlabcentral/answers/73682-simulink-cannot-propagate-the-variable-size-mode-from-the-input
最后我是如何解决问题的呢?
非常简单,有一个子系统出现了两个积分环节,不要使用Library Browser选择两次,直接复制上一个,粘贴下一个。这是输出。输入同样不选择两次In1,复制粘贴上一次的。问题得到解决。
不清楚原理是什么,但是的确是这样解决的。
还想谈一下上述网址中第二个回答,其中提到“You can right-click the matlab function block, choose explore, and set its output to a "variable size" with upper and lower bounds on its dimension.”笔者认为这有造假嫌疑,万一是发散的,这就是非得限幅使他不发散。而且对于我的问题也没有解决。
另外,如果出现报错是不能有Inf输入,原因一般是分母出现了零,设置一个初值即可解决。

猜你喜欢

转载自blog.csdn.net/sinat_37225468/article/details/54017744