Borrar filtros
Borrar filtros

Compare of symbolic expression for trigonometric

2 visualizaciones (últimos 30 días)
jun wei
jun wei el 20 de Feb. de 2023
Editada: Askic V el 20 de Feb. de 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 comentario
Askic V
Askic V el 20 de Feb. de 2023
One thing that comes to my mind is this:
isequal(expand(A), expand(B))

Iniciar sesión para comentar.

Respuesta aceptada

Askic V
Askic V el 20 de Feb. de 2023
Editada: Askic V el 20 de Feb. de 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).

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by