Average(Variable, Variable) Function

Top 

Description

Calculates the moving window average of a value using the specified number of data points.

 

Timing Precision Mode

This page describes functionality in millisecond timing precision mode.

 

Note: This method has a state. See the Methods and Properties with State page for more information.

 

Function Signature

Average(

Variable valueToAverage,


Variable pointsToAverage)

 

 

Arguments

valueToAverage


Description:

The value to average.

 

 

pointsToAverage


Description:

An integer value representing the maximum number of data points to average over.

Valid Range:

pointsToAverage ≥ 2

 

 

 

Return Value

Type:

number

 

 

The average calculated from the specified number of data points. If the number of data points is less than or equal to the specified number of of data points to average, then an ordinary "simple" average of the data is performed. Otherwise, a "moving" or "sliding" average is performed.

 

Syntax

myVariable1 = Average(myVariable2, myVariable3);

 

 

See also

Average