 About Us | Contact Us

# MAXVAL

 Platform x64, Win32, .NET Purpose To get the maximum value of the elements of an array. Class Transformational function. Syntax FUNCTION MAXVAL(ARRAY, DIM [, MASK]) FUNCTION MAXVAL(ARRAY [, MASK]) INTEGER DIM LOGICAL MASK Description ARRAY is an integer or real array. DIM is a scalar integer in the range 1 < DIM < n where n is the rank of ARRAY. MASK is a logical array that is conformable with ARRAY. Return value This function determines the maximum value of the elements of ARRAY along dimension DIM corresponding to the true elements of MASK. The result is a scalar or array having the same type. If DIM is not present, the result is scalar, otherwise the result is of rank n - 1 and has a shape that is the same as that of ARRAY but omitting dimension DIM. If ARRAY has size zero, MAXVAL(ARRAY) gives the negative number of largest magnitude for the given type and kind type. If MASK is false for all elements then MAXVAL(ARRAY, MASK=MASK) gives the negative number of largest magnitude for the given type and kind type. Example If A = [3, 2, 9, 9] then MAXVAL(A) is 9. If A = then MAXVAL(A, MASK = A .LT. 5) is 4. If A = then MAXVAL(A, DIM = 1) is [5, 6, 7, 8] and MAXVAL(A, DIM = 2) is [8, 7]