필터 지우기
필터 지우기

how can I delete zeros after virgule?

조회 수: 1 (최근 30일)
Mira le
Mira le 2023년 6월 15일
편집: Stephen23 2023년 6월 15일
hello
I have vector with values
0.254 0.435
I want to be 0.2 0.4

채택된 답변

Matt J
Matt J 2023년 6월 15일
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개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by