Round to Nearest Multiple of 4.

13 visualizaciones (últimos 30 días)
Arnab Pal
Arnab Pal el 5 de Abr. de 2019
Respondida: Rik el 5 de Abr. de 2019
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?

Respuesta aceptada

Rik
Rik el 5 de Abr. de 2019
a=45;
k=4;
b=k*round(a/k);

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by