Suppose there can be the max value at more than one location, how can I catch the first max value.
A = [6;7;21;4;9;21;5;1];
[maxValue, linearIndexesOfMaxes] = max(A(:));
[rowsOfMaxes colsOfMaxes] = find(A == maxValue)
Then I want it to be:
Can anyone please help me?