LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reordering columns of two dimensional matrix

Hello all,
How to reorder the columns of a two dimensional matrix as per the conditions given below
 
1. The front panel should contain a string  control. when supplied a list of indices of column  in  the string control. The ordering of the columns should be done according to the order list provided .
2. when  0s are entered in the string control ,  column values of that index should contain 0s.
 
 please provide a solution or VI  for this . regards
renault
0 Kudos
Message 1 of 4
(2,803 Views)

Hi Have you tried Array->reshape Array?

cheers

Pawel

 

0 Kudos
Message 2 of 4
(2,783 Views)
I think this VI (7.0) will do what you mean - it creates an array the same size of the original and extracts the columns from the original.
 
2 points -
  • 0 is a problem because in LV (like many other computer languages), 0 is the first element. -1 will do what you wanted instead.
  • This assumes space as a seperator between the values in the string. You may wish to have a 1D numeric array instead of the string.

___________________
Try to take over the world!
Message 3 of 4
(2,783 Views)
Hello tst and pawel ,
 thanks tst for the VI .absolutely matches to the requirement . 
really a great source of learning some wonderful tricks here .
meanwhile i try with the reshape one  too  pawel, as you suggested.
 thanks again
0 Kudos
Message 4 of 4
(2,775 Views)