This routine is written in the IDL language. Its source code can be found in the file meanabsdev.pro in the lib subdirectory of the IDL distribution.
; Define an n-element vector:
x = [1, 1, 1, 2, 5]
; Compute average deviation from the mean:
result = MEANABSDEV(x)
; Print the result:
Returns the average deviation.
An n-element vector or array of any numeric type.
Set this keyword to force computations to be done in double precision arithmetic and to return a double precision result. If this keyword is not set, the computations and result depend upon the type of the input data (integer and float data return float results, while double data returns double results). This has no effect if the MEDIAN keyword is set.
Set this keyword to return the average deviation from the median. By default, if MEDIAN is not set, MEANABSDEV will return the average deviation from the mean.
Set this keyword to cause the routine to check for occurrences of the IEEE floating-point values NaN or Infinity in the input data. Elements with the value NaN or Infinity are treated as missing data.