Re: Select x s.t. y>10

*To*: mathgroup at smc.vnet.net*Subject*: [mg13988] Re: [mg13957] Select x s.t. y>10*From*: Jurgen Tischer <jtischer at col2.telecom.com.co>*Date*: Sat, 12 Sep 1998 16:59:12 -0400*References*: <199809111906.PAA23158@smc.vnet.net.>*Sender*: owner-wri-mathgroup at wolfram.com

Hi Jason, In[1]:= li=Table[{n^2,n},{n,10}]; In[2]:= Cases[li,x_?(#[[2]]>5&):>(x[[1]]),1,1] Out[2]= {36} Jurgen Jason Gill wrote: > I came across what seems like it should be a simple little function, but > could not come up with a clever way to implement it. Generally, what I > am trying to do is take a list of lists of length 2 ie a list of x,y > coordinates, and Select x values based on some criterion for y. For > example I want to select the first x value for which the corresponding > y is greater than 5. > I can write a function using Position and Take etc. , but there must be > a clever,and more efficient way to do this. Any thoughts... Jason > > -- > Jason Gill > IBM Microelectronics > Essex Junction, VT 05452 > Phone (802)769-3350 > Fax (802)769-1220 > email: jgill at vbimail.champlain.edu > jasongil at us.ibm.com

**References**:**Select x s.t. y>10***From:*Jason Gill <jgill@vbimail.champlain.edu>