MathGroup Archive 2004

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

Search the Archive

Label of Max[list]


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


  • Prev by Date: Re: FindMinimum and the minimum-radius circle
  • Next by Date: Hypergeometric function
  • Previous by thread: RE : Beware of NSolve
  • Next by thread: Re: Label of Max[list]