LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting elements from array X where the elements are specified from another array Y

Hello All,
I have an array X (say 10 elements) and an other array Y (say 3 elements). I would like to make a new array with the elements [x(y1), x(y2), x(y3)]. How do I do this most efficiently. In my problem the array sizes are large.

Thanks,
Karthik.
0 Kudos
Message 1 of 2
(2,437 Views)
See the attached subvi I made to do that for floating point values. The basic idea is to run both arrays into a For loop, but only auto-index on 'Y', the array of indices. Also use auto-indexing to generate the output array.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 2
(2,437 Views)