How to round UP to 1 decimal value?

12 vues (au cours des 30 derniers jours)
Ramadhan Hakim
Ramadhan Hakim le 23 Oct 2020
Commenté : Ramadhan Hakim le 23 Oct 2020
Suppose I have a value x = 6.543. I want to round it up to 6.6.
I tried
x = 6.543;
x_round = round(x,1);
But it always returns x_round=6.5
Thanks in advance!

Réponse acceptée

Alan Stevens
Alan Stevens le 23 Oct 2020
Modifié(e) : Alan Stevens le 23 Oct 2020
ceil(x*10)/10
  1 commentaire
Ramadhan Hakim
Ramadhan Hakim le 23 Oct 2020
Thanks, it works!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by