12-06-2015 04:13 AM
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
12-06-2015 08:34 AM
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:
Ben64
12-06-2015 10:22 AM
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
12-06-2015 11:24 AM - edited 12-06-2015 08:44 PM
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.
12-06-2015 11:39 AM - edited 12-06-2015 11:40 AM
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.