comparison examples/private/iswhole.m @ 1:7750624e0c73 version0.5

(none)
author idamnjanovic
date Thu, 05 Nov 2009 16:36:01 +0000
parents
children
comparison
equal deleted inserted replaced
0:5181bee80bc1 1:7750624e0c73
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;