LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting a 2-Dimensional array

I've got a two-dimensional array with data stored in each column.
Is it possible to get each column of the array separately?
It would be like splitting the 2-dimensional array into
one-dimensional arrays, so that I can evaluate each column of the
two-dimensional array separatel? For example:
2-dimensional array would look like this:

2 5 6 9
3 6 8 10
4 7 8 9

and the corresponding four 1-D arrays would then look like:
Array 1:
2
3
4

Array2:
5
6
7

Array3:
6
8
8

Array4:
9
10
9

Thanks!
0 Kudos
Message 1 of 3
(3,066 Views)
Use the index array function. As you wire it to your array, it will reshape automatically with two index inputs, the second being 'Disabled index (col)'. If you wire a constant to the second index, you can extract from the array the desired colums (since it is a zero-based index, wire 0 to extract the first column, your 2-3-4 array, 1 for the second and so on).
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,066 Views)
Hi marc,
find attached VI ... I'm splitting your array in two different ways - one is for separate column computing (index array) and the other for 'loop' related operations.
Hope this helps.
0 Kudos
Message 3 of 3
(3,066 Views)