ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sorting a very large 2D array

Hi,
I'm looking for a way to sort a (16 x 4001) 2D array. There is a solution posted for an n x 2 array. However, it won't work for this large one. Could someone help me? Thanks!!!
0 Kudos
Message 1 of 9
(5,394 Views)
Jen,
I'll let you double-check it, but attached is a 'Sort 2D Array' VI. Its from NI, and as far as I can tell, it should handle your task. If not, it may offer some ideas.
Good luck with it, Doug
Message 2 of 9
(5,394 Views)
Thanks Doug! But unfortunately, I can't use it because I only have LabVIEW 5.0. Thank you for the suggestion though. 😃
Jen
0 Kudos
Message 5 of 9
(5,394 Views)
Jen wrote:
>
> Hi,
> I'm looking for a way to sort a (16 x 4001) 2D array. There is a
> solution posted for an n x 2 array. However, it won't work for this
> large one. Could someone help me? Thanks!!!

Hello,
could you tell us what you mean by sorting a 2D array? This seems to be abiguous to me.
--
Pierre Meyer                        
0 Kudos
Message 3 of 9
(5,394 Views)
I meant that I wanted to sort a 2D array by one of its columns. Kind of like how you would sort a block of data in Excel by one column.
0 Kudos
Message 4 of 9
(5,394 Views)
You could use one of those "standard"-algorithms such as bubble-sort or
quick-sort. It isn't fast, but it works.

Philipp
0 Kudos
Message 6 of 9
(5,394 Views)
A very simple way is to convert the 2D array into a 1D array of cluster of
1D array (in a For Loop, bundle the indexed 1D array). Sort the 1D array
of clusters and reconstruct the 2D array (unbundle in a For Loop).

Jean-Pierre Drolet


"Jen" a écrit dans le message news:
5065000000080000009C240000-993342863000@exchange.ni.com...
> Hi,
> I'm looking for a way to sort a (16 x 4001) 2D array. There is a
> solution posted for an n x 2 array. However, it won't work for this
> large one. Could someone help me? Thanks!!!


LabVIEW, C'est LabVIEW

0 Kudos
Message 7 of 9
(5,394 Views)
Here is the example file Doug attached in his answer but for LabVIEW version 5.0. Hope this helps. /Mikael
Message 8 of 9
(5,394 Views)
THANK YOU! 😃 this is perfect.
0 Kudos
Message 9 of 9
(5,394 Views)