modifying/rounding/aproximating a number
1 次查看(过去 30 天)
显示 更早的评论
i need a way to modify a number a=2.65987 into 2.6598 i tried round /fprintf , but both display as 2.6599 ,i need it badly ,i could just pop it out of nowhere by substracting 0.00007 but that's not helping .
0 个评论
采纳的回答
Star Strider
2020-10-30
One option:
c = floor(a*1E4)/1E4
producing:
c =
2.6598
.
6 个评论
Star Strider
2020-10-31
Interesting!
Check the link I posted — the link information is correct.
While I would normally suggest that the difference between the two in the precision of the diaplayed numbers could account for the difference, that is not the situation here, where the display precision is not changing.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!