COLMAXIDX

Purpose:

Returns a row of indices for the maximums of each column of the input table.

Syntax:

COLMAXIDX(a, unravel)

a

-

A series or multi-column table.

unravel

-

Optional. An integer indicating if "unraveled" (i.e. sequential) indices should be returned:

0:

Normal indices (default)

1:

Unraveled (sequential) indices

Returns:

A row series.

Example:

W1: {{1, 2, 3},

     {2, 1, 3}, 

     {3, 2, 1}} 

 

W2: colmaxidx(w1)

 

W2 == {3, 1, 1}

Example:

a = colmaxidx(W1, 1)

b = colmax(W1)

c = W1[a]

 

a == {{3, 4, 7}}

b == c == {{3, 2, 3}}

Remarks:

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.

See Also:

COLLENGTH

COLMAX

COLMIN

COLMINIDX

FIND

FMAX

FMIN

MAX

MAXIDX

MAXLOC

MAXVAL

MIN

MINLOC