09-02-2014 10:37 AM
I am currently receiving this error "The sizes of the input matrices are incompatible. Verify that the matrices have the same size or that one is a scalar."
I have two matrices one is having 1 element in row and 200 elements in column. Other is having 1 row and 230 elements in column.
Can any body guide me how to fix this type of problem. I want to do the follwing operation on them (see attached image for details).
Is it suitable to convert them to scalar and perform that operation or make their size equal and then perform the required operation? Which one is more suitable please suggest and also please guide how to do it?
JK
09-02-2014 10:45 AM - edited 09-02-2014 10:48 AM
Obviously, the 2D arrays (not matrices!) are not of equal size, so you need to decide what you want to do. You can either trim the larger array to the size of the smaller one or pad the smaller array to the size of the larger one with a suitable value (e.g. zero).
If you would use plain LabVIEW instead of mathscript, the trimming would be automatic. Just subtract the two arrays and take the absolute value. No script node needed.
Since you only have one row, 1D arrays would be sufficient. Why do you use 2D arrays? Where is the data coming from?
09-02-2014 10:54 AM - edited 09-02-2014 10:56 AM
josephkirmani wrote:
I have two matrices one is having 1 element in row and 200 elements in column. Other is having 1 row and 230 elements in column.
Those are 1D Arrays. So let's treat them as such.
And as Christian said, just use native LabVIEW instead of the Mathscript. Be warned that the output of this method will be the size of the smallest of the two arrays. You will need to add padding if you want to result in the larger of the two arrays.