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
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에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2020년 5월 14일

답변:

2020년 5월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by