A(p)

Read(740) Label: member, new sequence,

Description:

Get members of a sequence according to the ordinal numbers of members of an integer sequence to create a new sequence.

Syntax:

A(p)

Note:

Here are sequence A whose lengh is n and the integer sequence p whose length is m. Get members in p and use their values as ordinal numbers to get members in A in order to generate a new sequence.

Parameter:

p

An integer sequence; the range of its member values is 0 and n. If P is an empty sequence, then return an empty sequence.

A

A sequence whose length is n

Return value:

A sequence

Example:

 

A

 

1

[a,b,c,d,e,f,g]

 

2

[1,3,5]

 

3

=A1(A2)

[a,c,e]

4

[1,3,5,10]

 

5

=A1(A4)

Report errors, as the index is out-of-bound.

6

=A1([])

[]

7

=A1([1,2,3,3])

[a,b,c,c]

Related function:

A (i)