LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting a 2D array in LV 5.1?

I need to sort a 2D array using LV 5.1.  Any guidance on how to do that much appreciated.
 
Jeff Bledsoe
Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 4
(2,860 Views)
LV 5 is quite far now. However, basic LV functions should still work similarly so we can try some simple data manipulations. You can still use the 1D array sort function, since, as explained in the Help, "if array is an array of clusters, the function sorts the elements by comparing the first elements".
You need to extract the colum to sort by, associate an index number to it, sort, then use the ordered index to reorder the original 2D array. This process is illustrated in the diagram picture below.
 

Message Edité par chilly charly le 11-10-2005 12:47 AM

Chilly Charly    (aka CC)
Message 2 of 4
(2,857 Views)
Thanks Charly, it worked. 
 
How do I rate your reply? 
Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 3 of 4
(2,840 Views)
Never mind, I saw the buttons after asking the question.  Thanks again.
Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 4 of 4
(2,837 Views)