採用された回答

Matt J
Matt J 2023 年 6 月 15 日

0 投票

floor([0.254 0.435]*10)/10
ans = 1×2
0.2000 0.4000

2 件のコメント

Mira le
Mira le 2023 年 6 月 15 日
thank you for your answer
but how keep just 0.2 0.4
remove zeros.
Stephen23
Stephen23 2023 年 6 月 15 日
編集済み: Stephen23 2023 年 6 月 15 日
"but how keep just 0.2 0.4 remove zeros."
Perhaps FORMAT does what you want:
format short
0.2
ans = 0.2000
format short G
0.2
ans =
0.2
Of course, that makes absolutely no difference to the value stored in memory.

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2017a

タグ

質問済み:

2023 年 6 月 15 日

編集済み:

2023 年 6 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by