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

25 views (last 30 days)
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 Comments
Debu Patil
Debu Patil on 19 Mar 2016
Thanks for the answer. It is useful to me. I struggled lot for this. Thank you.

Sign in to comment.

Accepted Answer

Stephen23
Stephen23 on 9 Mar 2016
Edited: Stephen23 on 9 Mar 2016
>> V=148.559;
>> 5*floor(V/5)
ans = 145
>> 5*ceil(V/5)
ans = 150

More Answers (0)

Community Treasure Hunt

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

Start Hunting!