Mercurial > hg > smallbox
annotate util/ksvd utils/iswhole.m @ 113:028599837f1d sup_158_IMG_Processing_toolbox_
Reimplementation of showdict.m function from KSVD toolbox - Image Processing toolbox independent.
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Tue, 24 May 2011 15:13:41 +0100 |
parents | c3eca463202d |
children |
rev | line source |
---|---|
idamnjanovic@70 | 1 function z = iswhole(x,epsilon) |
idamnjanovic@70 | 2 %ISWHOLE Determine whole numbers with finite precision. |
idamnjanovic@70 | 3 % Z = ISWHOLE(X,EPSILON) returns a matrix the same size as X, containing |
idamnjanovic@70 | 4 % 1's where X is whole up to precision EPSILON, and 0's elsewhere. |
idamnjanovic@70 | 5 % |
idamnjanovic@70 | 6 % Z = ISWHOLE(X) uses the default value of EPSILON=1e-6. |
idamnjanovic@70 | 7 |
idamnjanovic@70 | 8 |
idamnjanovic@70 | 9 % Ron Rubinstein |
idamnjanovic@70 | 10 % Computer Science Department |
idamnjanovic@70 | 11 % Technion, Haifa 32000 Israel |
idamnjanovic@70 | 12 % ronrubin@cs |
idamnjanovic@70 | 13 % |
idamnjanovic@70 | 14 % May 2005 |
idamnjanovic@70 | 15 |
idamnjanovic@70 | 16 if (nargin<2), epsilon = 1e-6; end |
idamnjanovic@70 | 17 z = abs(round(x)-x) < epsilon; |