Label of Max[list]
- To: mathgroup at smc.vnet.net
- Subject: [mg50186] Label of Max[list]
- From: "Dr. Wolfgang Hintze" <weh at snafu.de>
- Date: Thu, 19 Aug 2004 06:28:21 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Is there a standard function providing beside the maximum of a list also the label(s) of the maximum? My solution is this In[23]:= wehMax[li_] := {m = Max[li], Select[Range[Length[li]], li[[#1]] == m & ]} In[24]:= li = Table[Random[], {100}]; In[25]:= wehMax[li] Out[25]= {0.9963517693166272, {89}} Is there a better one? Any hint appreciated. Wolfgang
- Follow-Ups:
- Re: Label of Max[list]
- From: DrBob <drbob@bigfoot.com>
- Re: Label of Max[list]
- From: János <janos.lobb@yale.edu>
- Re: Label of Max[list]