The MIN function returns the value of the smallest element of Array. The type of the result is the same as that of Array.
Result = MIN( Array [, Min_Subscript] [, DIMENSION=value] [, MAX=variable] [, /NAN] [, SUBSCRIPT_MAX=variable])
Returns the smallest array element value.
The array to be searched.
A named variable that, if supplied, is converted to a long integer containing the one-dimensional subscript of the minimum element. Otherwise, the system variable !C is set to the one-dimensional subscript of the minimum element.
Set this keyword to the dimension over which to find the minimum values of an array. If this keyword is not present or is zero, the minimum is found over the entire array and is returned as a scalar value. If this keyword is present and nonzero, the result is the "slice" of the input array that contains the minimum value element, and the return values for Result, Min_Subscript, MAX, and SUBSCRIPT_MAX will all be arrays of one dimension less than the input array. That is, if the dimensions of Array are N1, N2, N3, and DIMENSION=2, the dimensions of the result are (N1, N3), and element (i,j) of the result contains the minimum value of Array[i, *, j].
For example:
arr = FINDGEN(2,3,2) PRINT, arr
IDL prints:
0.00000 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 7.00000 8.00000 9.00000 10.0000 11.0000 PRINT, MIN(arr, DIMENSION=2)
IDL prints:
0.00000 1.00000 6.00000 7.00000 PRINT, MIN(arr, DIMENSION=1)
IDL prints:
0.00000 2.00000 4.00000 6.00000 8.00000 10.0000
The name of a variable to receive the value of the maximum 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 values NaN or Infinity in the input data. Elements with the value NaN or Infinity are treated as missing data. (See Special Floating-Point Values for more information on IEEE floating-point values.)
| Note |
Set this keyword equal to a named variable that will contain the one-dimensional subscript of the maximum element, the value of which is available via the MAX keyword.
This routine is written to make use of IDL's thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the
; Create a simple two-dimensional array: D = DIST(100) ; Find the minimum value in array D and print the result: PRINT, MIN(D)
Introduced: Original