Issue with precision using days function
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
