LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

krearrange row matrix

Hi, I have problem in rearrange back the row for matrix based on my instruction. For example let say we have 5 row and 5 column

 

 a b c d e
 f  g h i  j
 k l m n o
 p q r s t
 u v w x y

 

so, i want to get row 1 jump to row 3, row 3 jump to row 2, row 2 jump to row 5 and so on. Can somebody help me?

 

0 Kudos
Message 1 of 7
(2,433 Views)

Hi jepsepah,

 

you should use IndexArray to index rows from your input array and ReplaceArraySubset to move those idnexed rows to their new position.

 

"i want to get row 1 jump to row 3, row 3 jump to row 2, row 2 jump to row 5 and so on."

Is there any hidden scheme in those repositioning algorithm or just random order?

Best regards,
GerdW


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

If you have the order defined then you can use an Index Array and For loop to do the Job.

 

Shuffle Array.png

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 7
(2,424 Views)

Thanks GerdW and P@Anand for your replies. I have tried P@Anand method but its look like I have got a transpose matrix as attach

0 Kudos
Message 4 of 7
(2,410 Views)

GerdW, the arrangement of row is important to further my project analysis. So, each row have their own characteristics.

0 Kudos
Message 5 of 7
(2,408 Views)

Remove auto indexing of the 2D DBL array coming into the FOR loop.

 

remove auto idnex.PNG

 

and then, remove Build arrray function after index function

Regards
Freelance_LV
TestAutomation Consultant
Message 6 of 7
(2,403 Views)

TQ Freelance

0 Kudos
Message 7 of 7
(2,381 Views)