next up previous contents index
suivant: Extract a sub-list : monter: Get an element or précédent: Get an element   Table des matières   Index

Extract a sub-list

If l is a list of size s, l[n1..n2] returns the list extracted from l containing the elements of indices n1 to n2 where 0 $ \leq$ n1 $ \leq$ n2 < s (in Xcas syntax mode) or 0 < n1 $ \leq$ n2 $ \leq$ s in other syntax modes. The equivalent prefixed function is at with a list and an interval of integers (n1..n2) as arguments.
See also : mid, section 1.37.3.
Input :
[0,1,2,3,4][1..3]
or
at([0,1,2,3,4],1..3)
Output :
[1,2,3]
Warning
at can not be used for sequences, index notation must be used, like in (0,1,2,3,4,5)[2..3].



giac documentation written by Renée De Graeve and Bernard Parisse