Take
Usage
• Take[list, n] gives the first n elements of list. • Take[list, -n] gives the last n elements of list. • Take[list, {m, n}] gives elements m through n of list. • Take[list, {m, n, s}] gives elements m through n in steps of s. • Take[list, , , ... ] gives a nested list in which elements specified by are taken at level i in list.
Notes
• Take uses the standard sequence specification (see Section A.3.5). • Take can be used on an object with any head, not necessarily List. • Take[list, , ] effectively extracts a submatrix from list. • New in Version 1; modified in 4.
|