MATLAB: Help with max function

max function

[Max,index]=max(array,[ ],2)….. Iam using this syntax to find the maximum value of every column but in case of two equal maximum values it returns the first one… how can I solve this?! Thanks

Best Answer

This code will return the row and column indices where the entry is equal to the column's maximum.
[rowIdx,colIdx] = find(A==max(A))