Hi!
I simply am applying the Max function to an array of data, but I want to know exactly which element the maximum corresponds to. I only have Mathematica version 9, so keep that in mind (i.e. I would like to explore "MaximalBy", but I can't).
Thank you for your time,
-Phil
I like when it's easy. Thank you very much!
but I want to know exactly which element the maximum corresponds to
Many ways. One way is to use Ordering
Ordering
a = {1, 3, 4, 2, 9, 0, 2, 4} Ordering[a, -1] (* {5} *)
So max is the 5th element. You also use Position[a, Max[a]]
Position[a, Max[a]]