Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: List manipulation question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67214] Re: List manipulation question
  • From: "dkr" <dkrjeg at adelphia.net>
  • Date: Sun, 11 Jun 2006 23:08:59 -0400 (EDT)
  • References: <e6ge0k$nh3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Here's a simpler approach than the ones detailed in my previous
message:

In[31]:=
list={3700, 3800, 3900, 3950, 4000, 4050, 4100, 4150, 4200, 4250, 4300,

 4350,  4400, 4450, 4500, 4550, 4600, 4650} ;
transformedFirstElement=list[[2]]-list[[1]];
transformedLastElement=Last[list]-list[[-2]];
transformedIntermediateElements=Drop[(RotateLeft[list,2]-list)/2,-2];
result=Join[{transformedFirstElement},
    transformedIntermediateElements,{transformedLastElement}]
Out[35]=
{100,100,75,50,50,50,50,50,50,50,50,50,50,50,50,50,50,50}

dkr


  • Prev by Date: Re:Thanks, mg67144: 3rd try!
  • Next by Date: Re: a list as an option
  • Previous by thread: Re: List manipulation question
  • Next by thread: Re: List manipulation question