Mercurial > hg > ishara
annotate signals/private/unify.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | 289445d368a7 |
children |
rev | line source |
---|---|
samer@1 | 1 % this is weird but it works |
samer@1 | 2 % nan means variable, so max(nan,x)=x |
samer@1 | 3 % inf means failure so max(inf,x)=inf |
samer@1 | 4 function z=unify(x,y) |
samer@1 | 5 if ~isfinite(x) || ~isfinite(y), z=max(x,y); |
samer@1 | 6 elseif x==y, z=x; |
samer@1 | 7 else z=inf; |
samer@1 | 8 end |
samer@1 | 9 end |