Issue with precision using days function
Afficher commentaires plus anciens
I have a varriable x (this x was generated by reading an excel file). Using variable explorer I can see: x=0.465277777777778.
If I do the following:
y = days(0.465277777777778);
y.Format = 'hh:mm:ss'
I get:
11:10:00
Which is correct, as it is in the excel file. However, when instead I use the variable, like this
y=days(x) =
y.Format 'hh:mm:ss'
I get:
11:09:59
As you see there is a second of difference. How can I fix this so that I get the correct value (11:10:00) using the variable x?
Obs: when I get do x - 0.465277777777778, I get -2.775557561562891e-16. So I think it has to do with precision.
I appreciate any hint. Thanks
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
