       Re: Q: Extract Elements from a List?

• To: mathgroup at smc.vnet.net
• Subject: [mg28983] Re: [mg28968] Q: Extract Elements from a List?
• From: BobHanlon at aol.com
• Date: Thu, 24 May 2001 04:07:00 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```list={a,b,c,d,e,f,g,h,i,j};
start = 3;
step = 2;

Take[list, {start, Length[list], step}]

Table[list[[k]], {k, start, Length[list], step}]

Flatten[Partition[list, 1, step, {-start}, {}]]

Extract[list, Table[{k}, {k, start, Length[list], step}]]

list[[Table[k, {k, start, Length[list], step}]]]

Bob Hanlon

In a message dated 2001/5/23 2:58:14 AM, robert.schuerhuber at gmx.at writes:

>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?
>

```

• Prev by Date: Re: MathGL3D: Keep axis when exporting to VRML ?
• Next by Date: RE: Q: Extract Elements from a List?
• Previous by thread: Re: Q: Extract Elements from a List?
• Next by thread: RE: Q: Extract Elements from a List?