LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

split 2 D-Array

Hello I nedd to split an 2D-Array in the following way into 2 Arrays.
 
1  2   3   4   5   6   7   8
9 10 11 12 13 14 15 16
....
 
into
1  2   5   6
9 10 13 14
...
 
and
3   4   7   8
11 12 15 16
...
 
like interleaving  pairs of columns.
 
The idea is that i can take the difference of values which have a row inbetween. (1-3, 2-4, 5-7 ect.)
I can achieve that if i can generate this two arrays out of one and then substract them from each other.
Or does someone have a better idea for this? 
thx
Simon
Using Labview 7.1
0 Kudos
Message 1 of 3
(2,889 Views)
Hi Simon,

two solutions come to my mind, but both need to build up new arrays.

1) You can index all rows and decimate them. Build up new arrays from the decimated ones.

2) Index trough your columns and subtract the appropriate columns. Then build up a new array from the resulting ones.

I would prefer solution 2. Solution 1 has to option to give you the decimated arrays too in case you need them.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,886 Views)
Or use the rotate 1D array function in a loop. See attached picture. Be aware that if you rotate the array by 2, the last 2 columns in the difference array are invalid.
Message 3 of 3
(2,883 Views)