function returns the value of the largest element of
. The type of the result is the same as the type of
Result = MAX(
Array [, Max_Subscript]
The array to be searched.
A named variable that, if supplied, is converted to a long integer containing the one-dimensional subscript of the maximum element. Otherwise, the system variable !C is set to the one-dimensional subscript of the maximum element.
A named variable to receive the value of the minimum array element. If you need to find both the minimum and maximum array values, use this keyword to avoid scanning the array twice with separate calls to MAX and MIN.
Set this keyword to cause the routine to check for occurrences of the IEEE floating-point value NaN in the input data. Elements with the value NaN are treated as missing data. (See
Special Floating-Point Values
for more information on IEEE floating-point values.)
Create a simple two-dimensional array by entering:
D = DIST(100)
Print the maximum value in array D and its linear subscript by entering:
PRINT, MAX(D, I), I
To convert I to a two-dimensional subscript, use the commands:
IX = I MOD 100
IY = I/100
PRINT, IX, IY
The maximum value of D is at location (50, 50) in the original array.