Suppose I have an array, a = [2 5 4 7]. What is the function returning the maximum value and its index?
a = [2 5 4 7]
For example, in my case that function should ret
In case of a 2D array (matrix), you can use:
[val, idx] = max(A, [], 2);
The idx part will contain the column number of containing the max element of each row.