Mercurial > hg > ishara
annotate signals/private/unify.m @ 19:1eb0ea29ec40
Doesn't belong here.
author | samer |
---|---|
date | Thu, 17 Jan 2013 13:32:19 +0000 |
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 |