MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Extract Elements from a List?

"Robert Schuerhuber" <robert.schuerhuber at> wrote in message
news:9efk6g$1d8 at

> i need to extract elements from a list, starting th element number x and
> than taking every yth element, eg:
> with
> list={a,b,c,d,e,f,g,h,i,j}
> start=3;
> step=2:
> i'd like to get the list
> {c,e,g,i}.



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

So with,


we get

Take[lst, {start, -1,2}]


For negative integers the position n is the -n th, counting left with the
last position given by -1.

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

  • Prev by Date: Re: Q: Extract Elements from a List?
  • Next by Date: RE: Q: Extract Elements from a List?
  • Previous by thread: Re: A tricky equation
  • Next by thread: Left-hand Sum, etc?