LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging signal based on condition

Dear all,

 

Based on your help from here https://forums.ni.com/t5/LabVIEW/How-to-get-number-of-occurrence-and-index-of-multiple-number-in/m-p...

now I can get the corresponding signal data when their positions are equal.

 

In order to make it easy to track and debug, I modified my program. Now I have an 2D array containing data values and a 1D array containing position value. I want to average the signal values when their position are equal.

In the attached VI, I can get the averaged array of signal value in two ways but this array only contains values of the largest position value. I know that this is because in order to find the indexes of the position array, the algorithm gives a sorted result. Also, it only run in one direction so when the previous index array adds a new element (means that there is one more signal at the equal position) it does not update.

 

How can I make it update the previous array when I get a new index?

 

Thank you so much!

0 Kudos
Message 11 of 11
(128 Views)