LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace Array Subset function does not behaves as descripbed in LV Help

I think the 'Replace Array Subset' function does not seem to behave as explained in the LV help. The help mentions that if you do not wire an index for a dimension, Replace Array Subset replaces all the elements in that dimension.
In my simple test I created a 10 element array with element 10 using the 'Initialize Array' function followed by the Replace array subset function with element '0' and no index wired. Now, I was expecting an output of 10 element array with '0' as the element in all indices. But, the function only replaces the first index.

Has anybody else noticed this?
Correct me if I am doing something wrong.

Thanks.

Anand
0 Kudos
Message 1 of 3
(2,777 Views)
Looks like the behavior you're seeing is reproducible on 1-D arrays. The description in LV Help is correct for n-dimensional arrays, for n>1 (try a 2-D array as a test).
0 Kudos
Message 2 of 3
(2,777 Views)
In case of 2-D array you have to connect the element equal to size of other dimension if you want to replace all the elements. For eg. if you have a 5 row by 2 col array and you want to replace the entire 2nd row with 0, then you have to wire 1 to the row index and the element should be a array of size of 2 with both elements 0.
0 Kudos
Message 3 of 3
(2,776 Views)