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