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

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