How to round up and down a value close to multiple of 5?

26 Ansichten (letzte 30 Tage)
Debu Patil
Debu Patil am 9 Mär. 2016
Kommentiert: Robert Scott am 10 Dez. 2023
V=148.559 how to get answer by rounding up to multiple of 5 V=150 how to get answer by rounding down to multiple of 5 V=145
  2 Kommentare
Debu Patil
Debu Patil am 19 Mär. 2016
Thanks for the answer. It is useful to me. I struggled lot for this. Thank you.
Stephen23
Stephen23 am 19 Mär. 2016
Bearbeitet: Stephen23 am 19 Mär. 2016
@Debu Patil: my pleasure!.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Stephen23
Stephen23 am 9 Mär. 2016
Bearbeitet: Stephen23 am 9 Mär. 2016
>> V=148.559;
>> 5*floor(V/5)
ans = 145
>> 5*ceil(V/5)
ans = 150

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by