LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Average of array elements

Hi, I have a VI that's acquire data from Compact Field Point. These data come from cFP like an array. But I need acquire these data three times and, so, average them. There's a way to do this or I will have to use the "Index Array" function to separate each element of array and, so, make the average of each one?

Any help will be appreciated
0 Kudos
Message 1 of 2
(4,330 Views)
It is not entirely clear to me what the array from the cFP contains (I have not used cFP). I see several possible scenarios:

1) The array is a 1D array consisting of a single reading taken from multiple channels

- In this case I am assuming that you want to average three of these data points. If this is the case then all you need to do is add the arrays together and divide by three.

2) The arrayis a 1D array consisting of multiple readings from the same channel

In this case I am assuming that you want to average all of the data from each of these sets then you can use a build array function to put make the three arrays into a single array, use the Sum function to add all of the array elements together, and then divide by the length of the array.

3) The array is a 2D array

In this case then you're receiving multiple readings from multiple channels. Since this solution is more difficult and I need more information to accurately answer your question I'll defer this solution unless needed.
0 Kudos
Message 2 of 2
(4,325 Views)