LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pick columns from several 2D arrays and merge them in new 2D arrays

Solved!
Go to solution

Dear all, I have a set of 2D arrays (let's say 3, but the number can vary according to the experiment). My aim is to sequentially take the i-th column of each array and merge all of them in 3 new 2D arrays. This procedure has to be repeated for all columns of the 3 2D input arrays, as in the graph attached

Thank you very much

Mario

0 Kudos
Message 1 of 4
(938 Views)

My initial idea is to use shift registers to input 2D array one by one (as their number can vary from experiment to experiment and are read from data files), then a nested FOR loop to pick up the columns and create the output 2D arrays. I made some tests, but it is a complete mess, so I got stuck and ask your help

Thanks

Mario

0 Kudos
Message 2 of 4
(927 Views)
Solution
Accepted by topic author mario_Cevese

If your input arrays have the same dimensions, you can pack them into 3D array.

See attached code. The result is also a 3D array.

0 Kudos
Message 3 of 4
(889 Views)

thanks, it is an easier and faster solution than what I expected.

time to test it now

0 Kudos
Message 4 of 4
(881 Views)