MathGroup Archive 2011

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

Search the Archive

Re: Pure functions and Select[] sequential elements of list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119316] Re: Pure functions and Select[] sequential elements of list
  • From: "Chris Degnen" <degnen at cwgsy.net>
  • Date: Mon, 30 May 2011 06:35:18 -0400 (EDT)
  • References: <irtb73$plj$1@smc.vnet.net>

Paul McHale wrote:
>
> Hi,
> 
> Does anyone know of a way to use a pure function to access current
> and next element of list with uses like Select[]?  ... I.e.
> 
> mList={1,2,3,4,5,7,6,8};
> Select[mList, (#? > #??)&]
> 

I would use this:

Part[mList, 
 Flatten[Position[#1 > #2 & @@@ Partition[mList, 2, 1], True]]]





  • Prev by Date: get Text primitive vector data
  • Next by Date: Can't make function periodic for t<0
  • Previous by thread: Pure functions and Select[] sequential elements of list
  • Next by thread: Re: Pure functions and Select[] sequential elements of list