Vector initialized as 0:0.01:100 contains entries that are not exact
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!