Vector initialized as 0:0.01:100 contains entries that are not exact
Show older comments
Hi,
I have a time vector initialized as 0:0.01:100. However, some of the entries are not exactly 0.01 apart. In other words, I am trying to understand why the difference for the two following vectors is not zero:
t1 = 0:0.01:100; % original time vector
t2 = round(t*100)./100; % rounded to two decimals
sum(t-a) % difference
ans =
-3.4989e-013
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!