read actual matrix value without rounding off
이전 댓글 표시
I have computed a matrix that "seems" to have numbers with very high precision, for instance, the number 1.000 in the matrix below
However, when I try to read the number r(1,3), I got a number which is rounded off to 1 and I need it with full precision.
Is there a way to prevent this automatic rounding while reading the values of a matrix?
r =
0.0000 0.0000 1.0000
-0.9135 0.4067 0.0000
-0.4067 -0.9135 0.0000
>> r(1,1)
ans =
1.7006e-09
>> r(1,2)
ans =
3.9261e-10
>> r(1,3)
ans =
1
답변 (1개)
Steven Lord
2020년 5월 14일
0 개 추천
Use the format function to change how the matrix is displayed. This does not change the values that are stored in the matrix, just how they are displayed.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!