Re: I don't know how to ....
- To: mathgroup at smc.vnet.net
- Subject: [mg2440] Re: I don't know how to ....
- From: pehowland at taz.dra.hmg.gb (Paul E Howland)
- Date: Wed, 8 Nov 1995 23:43:39 -0500
- Organization: LSC2 Division, Defence Research Agency
In article <471hgv$gb3 at ralph.vnet.net>, bientin at cli.di.unipi.it (Paolo Bientinesi) writes: |here's my problem: |I need a function that takea as input a list of pairs; |the first element of every pair is a list, the second one is an integer; |I want the function to calculate thhe |biggest integer and to give as output the corresponding list. Assuming your list is like: data = {{{1,2,3},0}, {{4,5,6},5}, {{7,8,9},3}} then the following will work: In[1]:= Part[data, Position[ Map[#[[2]]&, data], Max[Map[#[[2]]&, data]] ][[1,1]], 1] Out[1]= {4, 5, 6} Hope this helps, Paul E Howland Tel. +44 (0)1684 895767 Long Range Ground Radar Sensors Fax. +44 (0)1684 896315 LSC2 Division Email. PEHOWLAND at DRA.HMG.GB Defence Research Agency St Andrews Road Malvern Worcestershire, WR14 3PS, UK =========================================================================