DADiSP Worksheet Functions > A - E > COLMAXIDX
Returns a row of indices for the maximums of each column of the input table.
COLMAXIDX(a, unravel)
a |
- |
A series or multi-column table. |
||||
unravel |
- |
Optional. An integer indicating if "unraveled" (i.e. sequential) indices should be returned:
|
A row series.
W1: {{1, 2, 3},
{2, 1, 3},
{3, 2, 1}}
W2: colmaxidx(w1)
W2 == {3, 1, 1}
a = colmaxidx(W1, 1)
b = colmax(W1)
c = W1[a]
a == {{3, 4, 7}}
b == c == {{3, 2, 3}}
COLMAXIDX finds the index of the maximum value for each column in an array. If more than one maximum exists per column, the first index found is returned.
COLMAXIDX(a, 1) returns the indices in sequential, unraveled order. This form is useful in array reference expressions.
Use MAXIDX to find the index of the overall maximum.