p.inv(k )

Description:

Compute the ordinal numbers of an integer’s members in another integer sequence.

Syntax:

p.inv(k)

Note:

The function returns the ordinal numbers of the members from 1 to k in integer sequence p. Return 0 for the numbers that do not exist in p.

Parameter:

p

An integer sequence

k

An integer, which is by default the length of p

Return value:

An integer sequence composed of the ordinal numbers of the integers from 1 to k in integer sequence p

Example:

 

A

 

1

=[1,3,5,7]

 

2

=A1.inv(4)

Among the four numbers 1, 2, 3 and 4, the ordinal numbers of 1 and 3 in sequence A1 are 1 and 2. 2 and 4 do not exist in sequence A1, so their ordinal numbers are 0. [1,0,2,0] is returned finally.

Related function:

A.inv(p)