Take
Usage
Notes
Further Examples
Here is a list.
In[1]:=
|
Out[1]=
|
This takes the first three elements of .
In[2]:=
|
Out[2]=
|
This takes the last two elements of .
In[3]:=
|
Out[3]=
|
This takes elements through in steps of .
In[4]:=
|
Out[4]=
|
Here is a matrix.
In[5]:=
|
Out[5]//MatrixForm=
|
This takes the submatrix consisting of the last rows of the first columns of .
In[6]:=
|
Out[6]//MatrixForm=
|
This defines the function iteratedTake which partitions a list s into non-overlapping sublists where the first sublist has t[[1]] elements, the second t[[2]] elements, and so on. If checkArgs[s, t] gives False then iteratedTake[s, t] will return unevaluated.
In[7]:=
|
In[8]:=
|
In[9]:=
|
Out[9]=
|
In[10]:=
|
|