LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Uniqueness of the array elements

Hi,

 

I've got the 1D array of the DBL values.

 

How to quickly check all of they are unique?

 

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

Index through the array in a loop.  Search that 1-D array for each element.  If the item is unique, there should be exactly 1 of that element in there.

0 Kudos
Message 2 of 4
(2,301 Views)
Sort. Then check each against its predecessor. Careful with equality checks, you may want to allow a small range to be considered equal.
0 Kudos
Message 3 of 4
(2,297 Views)

What happens if you're comparing two NaN entries in a numeric array?

 

Edit - by which I mean to say that, as usual, altenbach has a pretty good example of this - have a read through the comments here

---
CLA
0 Kudos
Message 4 of 4
(2,258 Views)