MAX inputVector resultVariable

Replaces the contents of the result variable with the largest value (most positive) from the input vector. If there are any "missing data" (Represented by "." or "NaN"), the result will be NaN.

If you don't want missing data to dominate the result, use the CLEAN command to remove NaNs before executing the MAX command.


COPY (1 2.5 3.7) A
MAX A B
PRINT A B

The above program produces the following output:

A: (1.0 2.5 3.7)
B: 3.7

If your vector has missing data, you can use CLEAN to remove them:

CLEAN A B
MAX B C
PRINT A C