MathGroup Archive 2001

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

Search the Archive

Re: Q: Extract Elements from a List?

Dear Robert,

Here is a quick solution

test = {a, b, c, d, e, f, g, h, i, j}
h[a_, d_] := Table[Part[test, n], {n, a, Part[Dimensions[test], 1], d}]

Here a function is designed to give you the list output you desire.
Here a is the first element to be extracted and d is the step size through
the list thereafter.

Let me know how this turns out!!

Thank you,

Robert Schuerhuber wrote:

> 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: Help fitting Exponential curves
  • Next by Date: RE: Q: Extract Elements from a List?
  • Previous by thread: Q: Extract Elements from a List?
  • Next by thread: RE: Q: Extract Elements from a List?