CIGAL Reference Manual, Chapter 3 (Functions): STATS
usage: results = stats(varb)
STATS summarizes the statistics for numbers in an array (or matrix, image, solid, etc.). The result of these calculations is an array of 12 numbers. The values in the output array are:
Result Value Function Description 0 SIZE(array) Total number of items 1 count Number of non-null items 2 non-zeros Number of non-zero and non-null items 3 SUM(array) Sum of all non-null items 4 MEAN(array) Mean of all non-null items 5 STDEV(array) Standard deviation of the mean 6 MAX(array) Largest non-null value 7 MIN(array) Smallest non-null value 8 MAX(array,0) Location of MAX value 9 MIN(array,0) Location of MIN value 10 firstval Location of first non-zero value 11 lastval Location of last non-zero value
If there are no non-zero values, then FIRSTVAL and LASTVAL are both 0.
(Note: Functions listed in capital letters can also be called separately as single-valued functions. The results in the STATS array are the same as if those functions had been called independently. Functions listed in lower case are not recognized as separate commands.)
The STATS command compiles statistics on NON-NULL values. NULL values are used to code missing values or illegal values (eg. non-number characters in a number entry). NULLS are defined for INTEGER, LONG, and REAL variables (but not for BYTE variables) and are stored as the value -0 (eg. 8000h for integers) (see ARITHMETIC(1)). Except for the SIZE result, STATS ignores NULL values.
Summary (also available as HELP STATSUM):
SIZE COUNT Non-ZEROS SUM MEAN St-DEV MIN MAX MinPos MaxPos FirstVal LastVal
See Also:
ARITHMETIC(1)