From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get and display array elements - indices determined by program

Hello,

 

I am trying to extract elements from an array under the following conditions:

  • The index of these elements are not known in advance
  • The number of elements needed is not known in advance
  • I will use these elements as the indices to obtain values from another array.

Background:

 

I am using the peak detector VI that ships with Labview 2012. Its output is an array of indices for which it found peak values above some threshold. I have rounded these indices to their nearest integer and want to use them to extract peak locations from another array (of wavelengths). I could just stick with using a single element, but I will not generally have a single peak.

 

I only see a way to wire a static number of inputs for the "index array" function. Likewise, given an unknown number of elements in my index array, how would one use these indices to extract elements from another array?

 

Thanks!

0 Kudos
Message 1 of 2
(1,945 Views)

Consider array subset, and also using index array in a for loop.

0 Kudos
Message 2 of 2
(1,943 Views)