Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2001

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

Search the Archive

RE: Q: Extract Elements from a List?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28995] RE: [mg28968] Q: Extract Elements from a List?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 24 May 2001 04:07:15 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Robert,

Look up Take in Help.

list = {a, b, c, d, e, f, g, h, i, j};
Take[list, {3, Length[list], 2}]
{c, e, g, i}

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/ 


> From: Robert Schuerhuber [mailto:robert.schuerhuber at gmx.at]
To: mathgroup at smc.vnet.net
> 
> hi!
> 
> probably a very easy question, but i couldn't find an answer in the
> mathematica-book:
> 
> 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}.
> 
> how can i do this in the easiest way?
> 
> regards, robert
> 
> 


  • Prev by Date: Re: Q: Extract Elements from a List?
  • Next by Date: Re: Help fitting Exponential curves
  • Previous by thread: Re: Q: Extract Elements from a List?
  • Next by thread: Re: Q: Extract Elements from a List?