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??

 Réponse acceptée

Walter Roberson
Walter Roberson le 17 Avr 2021

1 vote

If all of the values involved are rationals then you can use the Symbolic Toolbox.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by