LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Group the array results

Hello everyone,

 

I want to compare the elements in 2 arrays, and return TRUE if both of them are greater than the others.

 

something like this,

IF Element1 of Array1 > Element1 of Array2 and Element2 of Array1 > Element2 of Array2 then return "TRUE"

IF Element3 of Array1 > Element3 of Array2 and Element4 of Array1 > Element4 of Array2 then return "TRUE"
IF Element5 of Array1 > Element5 of Array2 and Element6 of Array1 > Element6 of Array2 then return "TRUE"
IF Element7 of Array1 > Element7 of Array2 and Element8 of Array1 > Element8 of Array2 then return "TRUE"
IF Element9 of Array1 > Element9 of Array2 and Element10 of Array1 > Element10 of Array2 then return "TRUE"

So there would be a Boolean array which has 5 elements.

 

but I don't know how to achieve this, any help is appreciated.

0 Kudos
Message 1 of 4
(1,441 Views)

YOur FOR loop can be deleted without any change in functionality. Keep it simple!

 

Maybe something like the following? (The function in the middle is "decimate 1D array", the rest should be clear.)

 

altenbach_0-1603237757670.png

 

I am not sure why you used "greater or equal" if the description talk about "greater", I am also not sure why you are using DBL for integers, so modify as needed)

 

0 Kudos
Message 2 of 4
(1,431 Views)

I would reshape the arrays so that you have 2 columns by 5 rows.

 

Auto-index through both in a For Loop using Index array to get column 1 and column 2, on each.  Then compare and AND the results.

0 Kudos
Message 3 of 4
(1,430 Views)

In more detail:

 

altenbach_0-1603237968348.png

 

0 Kudos
Message 4 of 4
(1,429 Views)