How to round UP to 1 decimal value?

13 ビュー (過去 30 日間)
Ramadhan Hakim
Ramadhan Hakim 2020 年 10 月 23 日
コメント済み: Ramadhan Hakim 2020 年 10 月 23 日
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!

採用された回答

Alan Stevens
Alan Stevens 2020 年 10 月 23 日
編集済み: Alan Stevens 2020 年 10 月 23 日
ceil(x*10)/10
  1 件のコメント
Ramadhan Hakim
Ramadhan Hakim 2020 年 10 月 23 日
Thanks, it works!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by