Mean

Description:              This function returns the mean (average) of a portion of a numerical array.

Returns:                    Numeric

Usage:                       Script or Steady State

Format:                      Mean(ArrayStart, N)

Parameters:             ArrayStart   { numeric array element}  { required }  { no default }

                                      Any numeric array element giving the starting element of the array. The index for the array may be any numeric expression and specifies the starting point for the array search. Unless specified, the lowest dimension of a multidimensional array is used.

                                    N   { numeric }  { required }  { no default }

                                      Any numeric expression giving the number of array elements to use starting at the element given by the first parameter. If N extends past the upper bound of the lowest array dimension, this computation will "wrap-around" and resume at element 0, until N elements have been processed.

Comments:               Invalid array elements are not included as part of the calculation, unless there are no valid numerical array elements in the specified range, in which case the function returns invalid. Invalid is also returned if either parameter is invalid, or if the number of elements to use is 0.

Example:

x[0] = Invalid;

x[1] = Invalid;

x[2] = Invalid;

x[3] = 1;

x[4] = 2;

x[5] = 1;

x[6] = 2;

avg = Mean(x[0], 7);

The value of avg will be set to 1.5.

See Also:

AMax | AMin | AValid | FiltHigh | FiltLow | FitOffset | FitSlope | SDev | Sum | Variance | Math Functions