LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sort a 2-dim array?

Hello!

Now we have the following problem: We need to sort a 2-dim array depending on the values in the first column. Then we need the corresponding row to move to the right place too... we send a VI so you can see an example of how it might look like. So we need (in this case) the first column to sort so we get 1,2 and 3 and so on, so the last row should be 3,4, 392 and 2047.

We think this might be easy to solve but we need some tip 🙂 Thank you and best regards.
0 Kudos
Message 1 of 4
(2,977 Views)
Hi
A visit to OpenG should help you. They have vis to sort different types of 2D arrays.
the web: http://openg.org/index.php

Hope it helps
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 2 of 4
(2,973 Views)
Hello!

Ok, so there is special VI-s to do this? We were thinking of maybe something with a for-loop and index and so on... maybe one can not do it oneselve? We will have a look at the website! Thank you for your help 🙂 Best regards.
0 Kudos
Message 3 of 4
(2,968 Views)
I wrote my own 2D string array sort routine. It has come in handy many times. You can enter the column number that you want to sort on, and the entire rows are rearranged in the order of the column sort. If your array is numeric, you can easily change the vi to use numerics instead. One day I hope to make it polymorphic. Here it is:
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,947 Views)