MATLAB: Is 0<0.01

comparesmall numbers

I'm trying to use the condition 0<0.01 in while loop, but it is never true in Matlab. Apparently 0 is always equal to 0.01.
How can I work around this?
I need to do:
c1= 0;
eps = .01
while c1<eps
do something
end

Best Answer

??
0 < 0.01 in MATLAB, as expected. 0 > 0.01 would be unexpected.
Also, re-check whether your c1 or your eps become vectors. The behavior of if and while when testing a non-scalar is well-defined but often a surprise.