comparison DL/RLS-DLA/private/iswhole.m @ 60:ad36f80e2ccf

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:20:59 +0000
parents
children
comparison
equal deleted inserted replaced
59:23f9dd7b9d78 60:ad36f80e2ccf
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;