Take
[expr, n]Take
[list, -n]Take
[list, {m, n}]Get the first three elements:
Take[{a, b, c, d}, 3]
Get the last two elements:
Take[{a, b, c, d}, -2]
Get the elements from the second element through the next to last element:
Take[{a, b, c, d, e}, {2, -2}]
Take a submatrix:
A = {{a, b, c}, {d, e, f}};
Take[A, 2, 2]
Take a single column:
Take[A, All, {2}]
Taking the 0th element does nothing, and returns an empty list:
Take[{a, b, c, d}, 0]
See also Drop
.