필터 지우기
필터 지우기

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 CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by