comparison util/ksvd utils/iswhole.m @ 70:c3eca463202d

(none)
author idamnjanovic
date Wed, 16 Mar 2011 14:16:57 +0000
parents
children
comparison
equal deleted inserted replaced
69:5f1f436057ca 70:c3eca463202d
1 function z = iswhole(x,epsilon)
2 %ISWHOLE Determine whole numbers with finite precision.
3 % Z = ISWHOLE(X,EPSILON) returns a matrix the same size as X, containing
4 % 1's where X is whole up to precision EPSILON, and 0's elsewhere.
5 %
6 % Z = ISWHOLE(X) uses the default value of EPSILON=1e-6.
7
8
9 % Ron Rubinstein
10 % Computer Science Department
11 % Technion, Haifa 32000 Israel
12 % ronrubin@cs
13 %
14 % May 2005
15
16 if (nargin<2), epsilon = 1e-6; end
17 z = abs(round(x)-x) < epsilon;