read actual matrix value without rounding off
Mostrar comentarios más antiguos
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
Respuestas (1)
Steven Lord
el 14 de Mayo de 2020
0 votos
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.
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!