The function is max. To obtain the first maximum value you should do
[val, idx] = max(a);
val is the maximum value and idx is its index.
The function is max. To obtain the first maximum value you should do
[val, idx] = max(a);
val is the maximum value and idx is its index.