Show more digit number in command window
조회 수: 33 (최근 30일)
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Steven Lord
2021년 12월 5일
Are you trying to display a numeric result (in which case you should use the format function to change the format used to display numeric results) or a symbolic result (in which case you could use vpa)?
댓글 수: 3
Walter Roberson
2021년 12월 5일
편집: Walter Roberson
2021년 12월 5일
Digits() only affects floating point symbolic numbers; it has no affect on double precision or single precision.
There is no method to get exactly 6 digits in the command window. "format short" will give you 5 digits, and "format long g" will give you 15 digits. There is no way to customize the display to 6 digits.
However... if you were to round(TheData, 6) and display it with "format long g" in effect, you would mostly see 6 or fewer digits
format short
A = rand(2,5);
A
round(A,6)
format long g
A
round(A,6)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!