This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Built-in Functions / Lists and Matrices / Element Extraction /


FilledSmallSquare Take[list, n] gives the first n elements of list.

FilledSmallSquare Take[list, -n] gives the last n elements of list.

FilledSmallSquare Take[list, m, n] gives elements m through n of list.

FilledSmallSquare Take[list, m, n, s] gives elements m through n in steps of s.

FilledSmallSquare Take[list, , , ... ] gives a nested list in which elements specified by are taken at level i in list.

FilledSmallSquare Take uses the standard sequence specification (see Section A.3.5).

FilledSmallSquare Examples: Take[a,b,c,d,e, 3] LongRightArrow.

FilledSmallSquare Take[a,b,c,d,e, -2] LongRightArrow.

FilledSmallSquare Take[Range[15], 3, 12, 4] LongRightArrow.

FilledSmallSquare Take can be used on an object with any head, not necessarily List.

FilledSmallSquare Take[list, , ] effectively extracts a submatrix from list.

FilledSmallSquare Example: Take[a,b,c,d,e,f, -1, 2] LongRightArrow.

FilledSmallSquare Applying Take to a SparseArray object normally yields another SparseArray object.

FilledSmallSquare See Section 1.8.4 and Section 2.4.2.

FilledSmallSquare See also: Part, Drop, StringTake, Select, Cases, Partition, PadLeft.

FilledSmallSquare Related package: LinearAlgebra`MatrixManipulation`.

FilledSmallSquare New in Version 1; modified in 4.

Further Examples