MAXPOSITION(x)
finds the position of the first instance of the maximum value within x
. For a variate this is the number of the unit containing the maximum. For a matrix the row of the maximum value can then be calculated as:
row = INTEGER((MAXPOSITION(x)-1)/NROWS(x)) + 1
and the column as
column = MAXPOSITION(x) - NROWS(x)*(row-1)
For a symmetric matrix, the column is
column = INTEGER((SQRT(8*MAXPOSITION(x)+1)+1)/2)
and the row is
row = MAXPOSITION(x) - column*(column-1)/2