LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Matching pairs in an array

Hi

Is there a quick way of scanning an array for matching pairs of values?

MTIA

Regards

Bill
0 Kudos
Message 1 of 4
(2,961 Views)
1) Sort the array.
2) compare current with previous in a loop.
3) Keep iterating until you are happy.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,961 Views)
If you need to keep your data ordered, just iterate from 0-end of array and run a "search 1d array" command on it.

This is much less efficient than sorting/iterative search, but it preserves array order.
0 Kudos
Message 3 of 4
(2,961 Views)
Bill;

You can use the Equal vi to accomplish this. Attached is a simple vi in which you can input a number to search if the number repeat in the array. It should be fairly easy to modify this vi to suit your need.

Regards;
Enrique
www.vartortech.com
0 Kudos
Message 4 of 4
(2,961 Views)