Example Code

Running Average of Array

Code and Documents

Attachment

Overview


The Running Average VI calculates a running average of an array with dynamic length and dynamic sampling speed.

The Running Average VI calculates a running average of an array with dynamic length and dynamic sampling speed. The VI allocates values to the Data array. The Size of data control determines the array length. When the VI reaches the last index of Data, the process begins again at the zero index.  During each while loop iteration, the VI complies the sum of all elements in Data and divides that value by the length of the Data array, determining the running average with dynamic length and speed. The VI displays the value of Running average for each while loop iteration.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors