annotate general/numerical/mmax.m @ 6:0ce3c2070089

Removed duplicate code and fixed doc in timed_action.
author samer
date Mon, 14 Jan 2013 14:33:37 +0000
parents e44f49929e56
children
rev   line source
samer@4 1 function [t,i,j]=mmax(A)
samer@4 2 % mmax - maximum over both dimensions
samer@4 3 %
samer@4 4 % mmax :: [[N,M]-A] -> A, 1..N, 1..M.
samer@4 5
samer@4 6 if nargout==1, t=max(A(:));
samer@4 7 else
samer@4 8 [t1,i1]=max(A,[],1);
samer@4 9 [t2,i2]=max(t1,[],2);
samer@4 10 t=t2;
samer@4 11 if nargout==3, i=i1(i2); j=i2;
samer@4 12 elseif nargout==2, i=[i1(i2) i2]; end
samer@4 13 end