フィルターのクリア

how to check if two symbolic fractions are the same?

2 ビュー (過去 30 日間)
Ali Almakhmari
Ali Almakhmari 2023 年 7 月 27 日
回答済み: the cyclist 2023 年 7 月 27 日
I have two fractions that have so many symbolic variables and are too complicated, but are in different forms. How can I check if they are equal to each other? For example:
syms x y z
fraction1 = (x+y)/(x*y) + z;
fraction2 = (x+y+x*y*z)/(x*y);
How can I check if fraction1 and fraction2 are the same?

採用された回答

Torsten
Torsten 2023 年 7 月 27 日
syms x y z
fraction1 = (x+y)/(x*y) + z;
fraction2 = (x+y+x*y*z)/(x*y);
isAlways(fraction1==fraction2)
ans = logical
1

その他の回答 (1 件)

the cyclist
the cyclist 2023 年 7 月 27 日
You can use isequal or isAlways, depending on the specific need. I suggest that you read the documentation, because there are nuances.

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by