 |
Take
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 uses the standard sequence specification (see Section A.3.5). Example: Take[
a,b,c,d,e
, 3] . Take[
a,b,c,d,e
, -2] . Take can be used on an object with any head, not necessarily List. See the Mathematica book: Section 1.8.4. See also: Part, Drop, StringTake, Select, Cases. Related package: LinearAlgebra`MatrixManipulation`.
Further Examples
This takes the first three elements from the list.
In[1]:= 
Out[1]= 
This takes the last two elements from the list.
In[2]:= 
Out[2]= 
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT. SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION. | | | |
 | |
|