MathGroup Archive 2006

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

Search the Archive

Re: List manipulation question


I can see now that my solution is very similar to the last one, of Bob
Hanlon, his is better though in a usage of ListConbolve, Rotate namely
must be familiar to everybody. (Everybody should learn something new
every day. :)

diff[l__]:=Flatten[{
      l[[2]]-l[[1]],
      Drop[(RotateLeft[l,2]-l)/2,-2],
      l[[-1]]-l[[-2]]}]


Anyway, my first working solution was by using rules:

list/.{first_,inb__,last_} :>
      {
        {inb}[[1]]-first,
        Drop[(RotateLeft[list,2]-list)/2,-2],
        last-{inb}[[-1]]
        }//Flatten


Good bye, Borut Levart from Slovenia.


  • Prev by Date: Why does Reduce work this way ...?
  • Next by Date: Determining continuity of regions/curves from inequalities
  • Previous by thread: Re: List manipulation question
  • Next by thread: Re: List manipulation question