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

 採用された回答

Walter Roberson
Walter Roberson 2021 年 4 月 17 日

1 投票

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

1 件のコメント

Enrique Ramos García
Enrique Ramos García 2021 年 4 月 18 日
Lots of thanks didnt know about it, im new :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by