function [t,i,j]=mmax(A)
% mmax - maximum over both dimensions
%
% mmax :: [[N,M]-A] -> A, 1..N, 1..M.

if nargout==1, t=max(A(:));
else
	[t1,i1]=max(A,[],1);
	[t2,i2]=max(t1,[],2);
	t=t2;
	if nargout==3, i=i1(i2); j=i2; 
	elseif nargout==2, i=[i1(i2) i2]; end
end
