Round to Nearest Multiple of 4.

56 ビュー (過去 30 日間)
Arnab Pal
Arnab Pal 2019 年 4 月 5 日
回答済み: Rik 2019 年 4 月 5 日
If my calculation gives, a= 45, I want 44. Some example: 20 would be 20, 13 would be 12, 10 would be 12 or 8. How to round the number like this way?

採用された回答

Rik
Rik 2019 年 4 月 5 日
a=45;
k=4;
b=k*round(a/k);

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by