MATLAB: Maximum value of matrix

let's say , I have matrix
A=[3 1;4 9 ;5 7 ];
A=[3 1
4 9
5 7 ];
I can find the maximum value from matrix A is 9:
max_value=max(max(A));
How can I get the value is in same row of 9, that is, 4 ?

Best Answer

[Val,ix]=max(A(:));
[r,~]=ind2sub(size(A),ix);
A(r,:) %complete row where maximum exists