Look at the min() and max() functions. They can return both the highest / lowest value and its index:
[B,I]=min(A(:)); %# note I fixed a bug on this line!
returns I=7 and B=A(7)=A(2,2) . The expression A(:) tells MATLAB to treat A as a 1D array, so although A is 5x5, it returns a linear index of 7.
If you need 2D coordinates, that is, β2.2β in B=A(7)=A(2,2) , you can use [I,J] = ind2sub(size(A),I) , which returns I=2,J=2 , see here .
Update
If you need all record indices that reach the minimum value, you can use find :
I = find(A==min(A(:));
I now the vector of all of them.
source share