APLX Help : Help on APL language : APL Primitives : ⌷ Index
|
|
|
|
|
The 2 ⌷ 1 2 3 4 5 (Scalar for vector indexing - only one
2 dimension)
(⊂3 4)⌷ 1 2 3 4 5 (Nested scalar for multiple index)
3 4
TAB←2 5⍴⍳10
TAB
1 2 3 4 5
6 7 8 9 10
2 3 ⌷ TAB
8
2 (2 3)⌷ TAB (Second element of the indexing vector
7 8 is the enclosed vector 2 3)
(1 2) (2 3)⌷TAB (Nested 2 element vector for multiple
2 3 index. Result is rows 1 2 and columns
7 8 2 3)
If the index function is given an empty left argument, and a scalar right argument, it will return the scalar as the result. (⍳0)⌷37
37
Index with axisIndex can be used with an axis specification. In this case the left argument only applies to those axes specified. Other axes are not indexed. 2⌷[1]TAB (Select the second member of the first
6 7 8 9 10 dimension - the rows)
(⊂2 3)⌷[2]TAB (Select the second and third members of the
2 3 second dimension - the columns)
7 8
|
|
APLX Help : Help on APL language : APL Primitives : ⌷ Index
|
|
Copyright © 1996-2010 MicroAPL Ltd