stateflow错误:Error in port widths or dimensions.

在使用stateflow中遇到

Error in port widths or dimensions. 'Output Port 1' of 'untitled3/Chart/input events' is a one dimensional vector with 6 elements.错误

原因是因为输入的信号数比定义的信号数多。一般是因为缺少 ‘开始触发事件’ 的定义。

例如下图中我在symbols中只定义了五个输入事件,但是在左图中却输入了六个信号,左图中最右边的阶跃信号是为了使得stateflow一开始运行就进入默认的转移状态,但是在容易被忽视。故只需要再定义一个输入事件就可以了,如最下方的图。

stateflow错误:Error in port widths or dimensions.stateflow错误:Error in port widths or dimensions.

stateflow错误:Error in port widths or dimensions.