MathGroup Archive 2009

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

Search the Archive

Re: pick out an element from list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98075] Re: [mg98011] pick out an element from list
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Sun, 29 Mar 2009 02:47:27 -0500 (EST)
  • References: <200903281040.FAA04302@smc.vnet.net>
  • Reply-to: drmajorbob at bigfoot.com

Like this?

test = RandomInteger[{0, 10}, 10]

{5, 9, 9, 2, 0, 4, 10, 4, 5, 4}

NestList[Rest[# - #[[1]]] &, test, 9]

{{5, 9, 9, 2, 0, 4, 10, 4, 5, 4}, {4, 4, -3, -5, -1, 5, -1,
   0, -1}, {0, -7, -9, -5, 1, -5, -4, -5}, {-7, -9, -5,
   1, -5, -4, -5}, {-2, 2, 8, 2, 3, 2}, {4, 10, 4, 5, 4}, {6, 0, 1,
   0}, {-6, -5, -6}, {1, 0}, {-1}}

Bobby

On Sat, 28 Mar 2009 05:40:09 -0500, bahadir <bahadirgurbuz54 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 process is the first step. i must apply all elements of the list,  
> invariably. Namely, in conclusion, i will obtain n list with n-1  
> elements. now, i will try 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 element 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. ı can't do  
> this, can anyone help me???
>



-- 
DrMajorBob at bigfoot.com


  • Prev by Date: Re: pick out an element from list
  • Next by Date: Re: Cycling through windows with a keyboard shortcut
  • Previous by thread: Re: pick out an element from list
  • Next by thread: Re: pick out an element from list