Periodic Number Problem Loosing Decimals

1 visualización (últimos 30 días)
Enrique Ramos García
Enrique Ramos García el 17 de Abr. de 2021
Comentada: Enrique Ramos García el 18 de Abr. de 2021
Hi, im solving a problem in which I need to different operations to a matrix and then compare the sum of each row to 1 (sum(A,2)==1) to see if its a transition matrix. However, in some operations i have to add periodic numbers, which make me loose decimales at the end of the program. Because of this when I compare the sum of each row which is 1.0000 to 1 it says its false. I know i could round it, however that wouldn`t be precise. Is there any form to make matlab represent the matrix numbers in a division so it doesn´t loose decimals??

Respuesta aceptada

Walter Roberson
Walter Roberson el 17 de Abr. de 2021
If all of the values involved are rationals then you can use the Symbolic Toolbox.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by