DADiSP Worksheet Functions > A - E > COLIDX

 

COLIDX

Purpose:

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

Syntax:

COLIDX(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:

An array or series.

Example:

W1: gnorm(5, 1)

W2: colidx(W1)

 

W2 == {1, 2, 3, 4, 5}

 

Example:

W1: {{10, 20, 30},

     {20, 10, 30}, 

     {30, 20, 10}} 

 

W2: colidx(w1)

 

W2 == {{1, 1, 1},

       {2, 2, 2}, 

       {3, 3, 3}} 

Example:

W1: {{10, 20, 30},

     {20, 10, 30}, 

     {30, 20, 10}} 

 

a = colidx(W1, 1)

b = W1[a]

 

a == {{1, 4, 7},

      {2, 5, 8}, 

      {3, 6, 9}} 

 

b == W1

Remarks:

COLIDX(a, 1) returns the indices in sequential, unraveled order. This form is useful in array reference expressions.

 

Use XVALS to return the X axis values.

 

COLIDX(a) == ROWNOS(a)

See Also:

COLLENGTH

COLNOS

IDX

ROWIDX

ROWNOS

XVALS