Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

simulink size mismatch

251 views
Skip to first unread message

rikhard

unread,
May 28, 2009, 11:16:31 AM5/28/09
to
I have this

[X0;VX]=[1,t;1,t1;1,t2;1,t3;1,t4]*[x,x1,x2,x3,x4]

inside a simulink, embedded matlab function and it gives this error

Size mismatch (size [2 x 1] ~= size [2 x 5]).
The size to the left is the size of the left-hand side of the assignment.

any one knows why? how can i fix this?

thanks

Phil Goddard

unread,
May 28, 2009, 8:34:01 PM5/28/09
to
Put a break-point on this line in the editor, run the model, and debug from there.

You haven't told us what you expect the dimensions of tX and xX to be.

Did you type this in to your post or copy and paste it from your code?
From the error message it appears that you've omitted a transpose on the first matrix being multiplied and that the xX's are 2-by-1 matrices (perhaps state vectors)?
In which case the right hand side does have dimension 2-by-5 as reported by the error message.

Phil.

0 new messages