LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The sizes of the input matrices are incompatible.

Hi Dear, 

 

As in the attached fiture, Labview warned me that "The sizes of the input matrices are incompatible. "

 

But it is really strange to me. Both 'error' and 'error0' should be the same size of 6 times 1 .

 

How may I address it?

 

Thanks so much!

Stanley

 

1.PNG

 

2.PNG

0 Kudos
Message 1 of 5
(3,209 Views)

StanleyC a écrit :

Hi Dear, 

 

As in the attached fiture, Labview warned me that "The sizes of the input matrices are incompatible. "

 

But it is really strange to me. Both 'error' and 'error0' should be the same size of 6 times 1 .

 

How may I address it?

 

Thanks so much!

Stanley

 


They are not matrices but 1D arrays and they are not 6X1. You have 1D arrays of 6 elements. You can convert them to 2D Arrays like this:

 

To 2D Array.png

 

Ben64

Message 2 of 5
(3,184 Views)

If you are going to learn LabVIEW, learn to use LabVIEW's (very good) Numeric Functions instead of Formula Nodes.  This will (a) avoid errors like the one you are seeing, (b) make your code much more comprehensible, especially to someone who knows a little LabVIEW, and (c) will make it easier to debug using LabVIEW's debugging tools.  Note it will also make it extremely easy for those of us who abandoned Matlab a decade ago and switched to LabVIEW to (almost instantly) see what you are trying to compute, and advise you if you are computing something that "makes sense".

 

Bob Schor

Message 3 of 5
(3,168 Views)

If you want help, attach the actual VI (or a simpliified version). We cannot debug pictures.

 

SInce you use an uninitialized feedback node, the first call will return an empty 1D array, which is arguably different in size to a 1D array with 6 elements. As a fisr step, you should also wire the array to the bottom terminal to globally initialized the feedback node.

Message 4 of 5
(3,158 Views)

Is there a reason you are using the mathscript node at all? Does it contain a lot of complicated legacy code?

 

It probably would be much easier to abandon Mathscript and do everything in pure g. Try it!

 

In the mean time you could replace the first line with the following code to get rid of the error and simplify the m code.

 

Message 5 of 5
(3,148 Views)