LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Highest element from multiple arrays

Solved!
Go to solution

I have four 1D arrays (each about 80 elements long) stored in slightly different places in a 'super-cluster' (the most relevant levels can be seen in the picture below). I need to find the value of the highest element in these arrays. I've come up with a couple of methods but it's getting late in the day and they all seem depressingly convoluted. What's the best/fastest way to do this? In a comparable example, I will also need to find the lowest element of four different arrays.

 

multi-array.JPG



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 1 of 6
(2,922 Views)
Solution
Accepted by topic author J.Mamakos

Use the Array Max &Min function

 

Ben64array max min.png

0 Kudos
Message 2 of 6
(2,914 Views)

I did consider that, but then convinced myself that creating a higher-level array just to find my answer was going a bit over the top! Or does it not really matter in this case?



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 3 of 6
(2,910 Views)

I'd say, in this case, the simpler the better.  Just use Build Array and use the Array Max & Min.  The other solution I would consider would be to use the Array Max & Min on each of the arrays, and then build an array of the maxes and use the Array Max & Min again.   But this sounds convoluted and probably a lot slower than just building a big array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(2,902 Views)

Since it's 4 arrays of 80 elements it won't cause any memory issue. If you had 4 huge arrays then it would be preferable to find each array max and then compare them.

 

Ben64

Message 5 of 6
(2,896 Views)

Okay, thank you. You can probably tell I didn't have a relaxing weekend! (so tired) Smiley Very Happy



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 6 of 6
(2,894 Views)