Effacer les filtres
Effacer les filtres

Compare of symbolic expression for trigonometric

2 vues (au cours des 30 derniers jours)
jun wei
jun wei le 20 Fév 2023
Modifié(e) : Askic V le 20 Fév 2023
I am trying to compare symbolic expressions i.e A=2*sin(x)*cos(x),B=simplify(A)=sin(2*x)
isequal(A,B)
but it return false.
Any ways to compare symbolic expression for trigo iden
  1 commentaire
Askic V
Askic V le 20 Fév 2023
One thing that comes to my mind is this:
isequal(expand(A), expand(B))

Connectez-vous pour commenter.

Réponse acceptée

Askic V
Askic V le 20 Fév 2023
Modifié(e) : Askic V le 20 Fév 2023
Perhaps, this is the way to go with sym expressions:
isAlways(A == B)
isAlways(cond) checks if the condition cond is valid for all possible values of the symbolic variables in cond. When verifying cond, the isAlways function considers all assumptions on the variables in cond. If the condition holds, isAlways returns logical 1 (true). Otherwise it returns logical 0 (false).

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