index - Maple Programming Help

index

construct an indexed expression

 Calling Sequence index(p, rest)

Parameters

 p - expression or name to be indexed rest - (optional) expression sequence of arguments to be passed to p

Description

 • The index(p, rest) calling sequence is equivalent to constructing the expression p[rest].
 • If p is an indexable expression, index(p, rest) evaluates to the result of indexing p by rest; otherwise, it simply returns the indexed expression ${p}_{\mathrm{rest}}$.  For more about indexing, see selection.
 Note: Calling index with one argument is equivalent to p[], that is, p indexed with an empty index.

Examples

 > $\mathrm{index}\left(f,s\right)$
 ${{f}}_{{s}}$ (1)
 > $\mathrm{index}\left(g\right)$
 ${g}\left[\right]$ (2)
 > $\mathrm{index}\left(f,s,t,u,v\right)$
 ${{f}}_{{s}{,}{t}{,}{u}{,}{v}}$ (3)
 > $\mathrm{index}\left(\left[7,4,8,9\right],3\right)$
 ${8}$ (4)
 > $\mathrm{map2}\left(\mathrm{index},\left[a,b,c,d\right],\left[4,2,1,3\right]\right)$
 $\left[{d}{,}{b}{,}{a}{,}{c}\right]$ (5)

Compatibility

 • The index command was introduced in Maple 2017.
 • For more information on Maple 2017 changes, see Updates in Maple 2017.