MathGroup Archive 2001

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

Search the Archive

Re: Uniquely Subtracting Elements in a Flat List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29196] Re: Uniquely Subtracting Elements in a Flat List
  • From: bghiggins at ucdavis.edu (Brian Higgins)
  • Date: Sat, 2 Jun 2001 17:56:06 -0400 (EDT)
  • References: <9fad6s$j7b$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Alan, Try this:
mylist = {a, b, c, d}
In[57]:=Drop[mylist - RotateLeft[mylist], -1]

Out[57]={a - b, b - c, c - d}

Cheers,
Brian


Alan <kd7cyb at mac.com> wrote in message news:<9fad6s$j7b$1 at smc.vnet.net>...
> I need help taking a flat list, such as {a,b,c,d} and generating another
> list by successively subtracting a-b, b-c, c-d, so that the resulting
> list would be {a-b,b-c,c-d}.
> 
> Thanks,
> Alan


  • Prev by Date: Repeating decimals
  • Next by Date: RE: Uniquely Subtracting Elements in a Flat List
  • Previous by thread: Re: Uniquely Subtracting Elements in a Flat List
  • Next by thread: RE: Uniquely Subtracting Elements in a Flat List