Hello everyone
I have a problem I would like to help me solving it
i have float value when I make division opeation and I obained value like this: 0.9093 0.9074 0.9014
I use round but I got: 0.9000 0.900 0.900 0.900
Iwant to remove these zeros to be 0.9 0.9 0.9 0.9
Thank you

 채택된 답변

VBBV
VBBV 2023년 6월 18일
편집: VBBV 2023년 6월 18일

0 개 추천

x = [0.9093 0.9074 0.9014]
x = 1×3
0.9093 0.9074 0.9014
vpa(round(x,1),2)
ans = 

댓글 수: 1

VBBV
VBBV 2023년 6월 18일

Use vpa with round to get the decimal precision you want. By default Matlab uses 4 decimal places for floatpoint numbers

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2017a

태그

질문:

2023년 6월 18일

편집:

2023년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by