MAXN N-D Array Maximum. MAXN(A) returns the maximum value found in the array A. [MX,Row,Col] = MINN(A) for 2-D A returns the maximum value MX as well as the row and column subscripts where the maximum appears. Row and Col are column vectors if multiple maximums appear in A. [MX,Idx] = MAXN(A) returns the maximum value MX as well as the linear indices Idx of all elements in A that are equal to MX. To get the row, column, ..., subscripts associated with the linear indices use IND2SUB(size(A),Idx).