modifying/rounding/aproximating a number
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Opariuc Andrei
il 30 Ott 2020
Commentato: Star Strider
il 31 Ott 2020
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 Commenti
Risposta accettata
Star Strider
il 30 Ott 2020
One option:
c = floor(a*1E4)/1E4
producing:
c =
2.6598
.
6 Commenti
Star Strider
il 31 Ott 2020
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.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!