Port dimensions error out of nowhere

1 view (last 30 days)
Simon Detmer
Simon Detmer on 22 Jul 2020
Commented: Jesús Zambrano on 2 Sep 2020
Hello,
so I've been using a .slx for a few weeks now, and today, without changing anything in the model, this error pops up:
Error in port widths or dimensions. 'Output Port 1' of 'Modell/Lageregelung/MATLAB Function' is a [3x3] matrix.
But the output is and has been a 3x1 vector.
Now if I insert a new Matlab function block with the following code
function FB = fcn(FL)
FB = FL;
which should just pass through the input, I get
Size mismatch (size [1 x 1] ~= size [3 x 1]).
For some reason Matlab expects FB to be 1x1, even though the size of FB is set to -1.
I have an older version of the .slx, and it works, even though I can't spot a difference anywhere.
I fixed the problem by setting the size of FB to 3 in the, but I would like to know what the issue is, since it cost me at least an hour of time.
  1 Comment
Jesús Zambrano
Jesús Zambrano on 2 Sep 2020
If you include more details of what the Modell/Lageregelung/MATLAB Function is about and the screenshot of the model that function is placed, you might get help. Otherwise, it'll be difficult to detect the reason of that error message.

Sign in to comment.

Answers (0)

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!