how to manage Fraction format problem
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear all, I have vector with numbers and fraction. How can I reduce fraction number.?for example a=[1.23456789 6.14521456 7.906342678 10.47609352]
expect results should be: re=[ 1.2 6.1 7.9 10.4] Thanks...
댓글 수: 0
채택된 답변
the cyclist
2017년 1월 30일
편집: the cyclist
2017년 1월 30일
One way to display a decimal number to one decimal place:
sprintf('%5.1f',a)
Note that this will not change the value stored in a; it will only display it differently.
추가 답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!