MathGroup Archive 2009

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

Search the Archive

Re: pick out an element from list


On Mar 28, 3:39=C2 am, bahadir <bahadirgurbu... at hotmail.com> wrote:
> i have a list with n element.i want to pick out an element from the list,=
 and to deduct the element from all the other residual elements. This proce=
ss is the first step. i must apply all elements of the list, invariably. Na=
mely, in conclusion, i will obtain n list with n-1 elements. now, i will tr=
y to explain as numerically. let element number of the list be 2500. and i =
am picking out the first element of the list. and i'm deducting the first e=
lement from the residual elements of the list. and now, i have a list with =
2499 elements.after that, i'm passing the second element, and i'm applying =
the same processes. =C4=B1 can't do this, can anyone help me???

I'm not sure if I follow but:

v = RandomReal[{0, 1}, 10];

First@NestWhile[Rest[#] - First[#] &, v, Length[#] > 1 &]

Which is same thing as:

Take[v, -2].{-1, 1}


  • Prev by Date: Re: pdf export problem
  • Next by Date: Re: pick out an element from list
  • Previous by thread: Re: pick out an element from list
  • Next by thread: Re: pick out an element from list