MATLAB: Matrix

matrixmax

Hi there, I have a square matrix and I want to find location of the maximum and minumum in each row.
EDITED!

Best Answer

EDIT
A = rand(5)
[id,id] = sort(A,2)
minrowloc = id(:,1)
maxrowloc = id(:,end)