how to write a program to round numbers
Mostra commenti meno recenti
Hi
how to write a proggram to round numbers whitout a prepared command in matlab like (round)
2 Commenti
Stephen23
il 23 Gen 2019
Are you allowed to use logical comparisons? Type conversion?
farid khalafi
il 23 Gen 2019
Risposte (1)
Rounding is the same as adding 0.5 and cropping the fractional part of the number.
For negative numbers you have to subtract 0.5.
To remove the fractional part, floor, ceil, fix and rem(x,1) can help.
Categorie
Scopri di più su Precision in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!