04-03-2007 04:49 PM
04-04-2007 06:49 AM
Hi Giorgos
the easiest thing to do is to cluster each line of the 2D array with the appropriate value of the numeric array, then sort the resulting new array (if sort is used on a cluster, it always sorts the first element), then split the cluster again.
Good luck
Guenther
04-04-2007 06:44 PM
11-26-2010 04:51 AM
Dear Guenther,
lately i ran into a similar problem and i used your way to sort my 1D-2D array but apparently there is a serious problem in my case. the sorting works fine, but this algorithm not only sorts the first 1D array but it also puts the second 2D array in order too; i mean in an ascending order. to make it easier to understand what i mean i attached my sample vi plus a screenshot.
as you can see the output array starts with an 'a-a' pair instead leaving the order like 'd-d,a-a,b-b' for the corresponding 0s in the first array.
i wonder if it is possible to sort only the first 1D-2D array in a way that the resulting 2D array would look like the following in this case:
d-d
a-a
b-b
h-h
c-c
f-f
e-e
Thanks,
Attila
11-26-2010 05:42 AM
Hi Attika,
you're right, if the first cluster elements are equal, then the sorting will proceed to the second element and so on.
If you want to prevent this, cluster your ID with an "uncritical" variable like an index and then use the index to sort the 2D array.
Example is attached.
Have fun
Guenther
11-26-2010 06:03 AM
Thank you!
This is exactly what i needed! You can't imagine how much you helped me! 🙂
02-17-2012 09:41 AM
Hello everybody, I am new to Labview. I am trying to arrange the 2d data in decending order according to numeric values but I am unable to getting decending orderd data, I want exacktly like Attika posted picture.Please can anybody help, here I am attaching my vi.
Thanks in advance.
02-17-2012 09:59 AM
What do you want the output array to look like? Which column or row do you want to sort on?
Mike...
02-17-2012 11:31 AM
@GuentherS wrote:
Hi Giorgos
the easiest thing to do is to cluster each line of the 2D array with the appropriate value of the numeric array, then sort the resulting new array (if sort is used on a cluster, it always sorts the first element), then split the cluster again.
Good luck
Guenther
Simple but really tricky one. Very nice