Here is a simple double array:
array=[3 1 1]
Largest element index is 1
or:
array=[3 9 1]
Largest element index is 2
How can I get the largest element index?
Use the second output argument of the max
function:
[ max_value, max_index ] = max( [ 3 9 1 ] )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With