Description: This function returns the arithmetic sum of all the valid array elements in a specified portion of a numeric array.
Returns: Numeric
Usage: Script or Steady State
Format: Sum(ArrayElem, N)
Parameters: ArrayElem { Array element } { required } { no default: }
Any array element giving the starting point in the array. The subscript for the array may be any numeric expression. 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.
Comments: Invalid array elements are not included in the calculation. The function returns an invalid result if either of its parameters is invalid, if there are no valid numerical array elements in the specified range, or if the number of elements to use is 0.
Example:
data[0] = 1;
data[1] = Invalid();
data[2] = 1.5;
data[3] = 3;
data[4] = 100;
dataSum = Sum(data[0], 4);
The value of dataSum is 5.5.
See Also:
AMin | AValid | FiltHigh | FiltLow | FitOffset | FitSlope | Mean | SDev | SumBuff | Variance