03-17-2015 11:32 AM
Hello,
I am attempting to make the case structure dynamic (or if there is another method), whereby if the entries in the first column change, that I can get the correct array output. In the attached VI, the case structure is hardcoded with the first column data.
In essence, I am trying to sort the array based on the entries in the first column. Is there a dynamic solution for this?
Thanks,
hiNi.
Solved! Go to Solution.
03-17-2015 11:37 AM
03-17-2015 11:55 AM - edited 03-17-2015 11:56 AM
@mikeporter wrote:
Turn each row of the 2d array into a cluster, resulting in a 1d array of clusters. Sort this array using the 1d sort node, then turn result back into a 2d array. Use loop parallelization when converting to/from cluster.
Mike...
Something like this...
03-17-2015 12:34 PM
03-17-2015 02:43 PM
Hello Mike,
I am trying to implent your last solution but I am not getting the right output. The "Array" does not match the "Current Array",i.e. Item 0 should be 136, item 1 should be 174 and so on...The "Array" is not the same as "Current Array"
Thanks,
hiNi.
03-17-2015 02:56 PM - edited 03-17-2015 02:57 PM
You're trying to hard. This is what I meant:
Like the note says, the conversion to the cluster defaults to 9 elements. So you may need to reset that. The conversion from cluster to array, doesn't care how may items are in the cluster.
Mike...
PS: If yiou want the first row to be handled differently, strip it off before you do this...
03-17-2015 03:16 PM
Hello Mike,
If I change the index on the "Current Array", you can see that the array is indexed correctly...Index 0 starts with 136, index 1 starts with 174 and so on...with your solutions, "Array" does not change till I index the array to 39, i.e. index 39 = start 174.
I am trying to get the data in a format such that I can select the relevant index and get the corresponding number...i.e. index 0 = 136, index 1 = 174 and so on. I would like to use this array (just like "Current Array") for data manulipation later on. Your solution is not allowing me to index the array correctly.
Thanks,
hiNi.
03-18-2015 07:46 AM
Maybe with a little help from Variant Attributes...