How to round up to the next 10
269 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Stwiwi
am 27 Sep. 2018
Kommentiert: Adam Danz
am 25 Aug. 2020
Hey, I have the following problem: I want to round up to the next 10. Meaning if I have x=14.5613, I want this to become x=20. I used the following Code:
x=14.5613;
x=round(x,-1);
x=10
To get x=20 I could just do this:
x=round(x,-1)+10
The Problem with this code comes when x is higher than 15. For example
x=18.5613
x=round(x,-1)+10
solves to x=30. So what I am looking for is a rounding function which rounds UP to the next 10 and NOT to the NEAREST. Can anybody help me? That would be awesome:)
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Switches and Breakers finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!