LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sorting a matrix

hello

kindly tell me how to sort a 2d array in a way that first check the first row and the highest element should be first element of the row  then check the 2nd row and higsest element should be the first element of 2nd row and so on. in the result the first coulumn should have highest element from the corrosponding row.

thnx

0 Kudos
Message 1 of 5
(2,765 Views)

Hi kitty,

 

use a FOR loop to autoindex your 2D array by rows.
 In the loop you use Sort1DArray to sort the array in "upwards" direction and Reverse1DArray to have the largest value as first element.

At the output of the FOR loop you will receive your 2D array with sorted rows...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,761 Views)

thnx Gerdw

but would u plz design a vi of this program for me....? i have some problem to understand it...

thnx

0 Kudos
Message 3 of 5
(2,743 Views)

Hi kitty,

 

as simple as described before:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(2,736 Views)

oh thnx GerdW!

itx realy works. and so simple too 🙂

thnx alot..

would u plz solve a problem about image processing?

0 Kudos
Message 5 of 5
(2,718 Views)