1
$\begingroup$

The Max and Min functions return values, but I would like to have the position(s). Is there a standard function that does this? Could not find one.

$\endgroup$
  • $\begingroup$ None that I know of but Ordering[#, -1] & might help. $\endgroup$ – Henrik Schumacher Feb 24 '18 at 11:54
  • $\begingroup$ @henrik Schumacher oke that is better then using position. Thx $\endgroup$ – Lou Feb 24 '18 at 15:13
  • 1
    $\begingroup$ If you know an upper bound, could do with Nearest as follows: In[271]:= Nearest[{2, 1, 3, 8, 2, 8, 5} -> "Index", 1000] Out[271]= {4, 6} $\endgroup$ – Daniel Lichtblau Feb 24 '18 at 20:06

Browse other questions tagged or ask your own question.