Returns the value of thelargest element in an input array.
max_subscript (optional) The subscript of the maximum element in array:
Min Used to specify a variable to hold the value of the minimum array element.
TIP: 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.
x = [22, 40, 9, 12] PRINT, MAX(x)
40
x = [3, 4, 5, 6, 7, 8, 9] maxval = MAX(x, maxindex, Min=minval) PRINT, maxval
9
PRINT, maxindex
6
PRINT, minval
3
a = [ [1,1,3,2], [3,4,1,3], [3,0,1,0], [0,1,2,0] ] & PM, a 1 3 3 0 1 4 0 1 3 1 1 2 2 3 0 0 PM, MAX( a, d=0 ) 3 4 3 2 PM, MAX( a, d=1 ) 3 4 3 3 a = INDGEN( 1, 2, 3, 4, 5 ) INFO, MAX( a, d=2 ) Expression INT = Array(1, 2, 1, 4, 5)