how can I delete zeros after virgule?

 Accepted Answer

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

2 Comments

thank you for your answer
but how keep just 0.2 0.4
remove zeros.
"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.

Sign in to comment.

More Answers (0)

Products

Release

R2017a

Asked:

on 15 Jun 2023

Edited:

on 15 Jun 2023

Community Treasure Hunt

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

Start Hunting!