MATLAB: Creating vectors from 0 to 1, i.e. 0:0.01:1 leads to invisible rounding errors

1 to nroundingrounding errorsmall numbersvector

Hi,
I came across the following problem while trying to merge two tables with innerjoin:
Whenever I create vectors counting up from 0 to 1 tiny rounding errors seem to creep in, which one can only notice when scaling the vector up i.e. looking at (0:0.01:1)'*100.
Is there a chance I might have screwed up my Matlab settings at some point?

Best Answer

Check "eps". Those are numerical artifacts introduced because you are accessing decimal points beyond the accuracy of MATLAB(double precision). Double is guaranteed to be accurate up to 15 significant digits (I think). The errors you see are the 16th or 17th significant digit of the original double you created i.e. 0.01.
This shouldn't effect your computation unless you do multiplication/division at very high orders of magnitude difference.