annotate general/numerical/array/mmax.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
db7f4afd27c5 |
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
|