1-cos(x)^2 doesn't simplify?

6 次查看(过去 30 天)
I found an ancient similar question, apperantly it used to work when at least x is not assigned. But when I try
syms x
simplify (1-cos(x)^2)
I get ans = 1 - cos(x)^2
Is there a reason for this, or is it just a bug?

采纳的回答

Cris LaPierre
Cris LaPierre 2021-5-3
Perhaps try using the Steps name-value pair.
syms x
simplify(1-cos(x)^2,'Steps',10)
ans = 
  3 个评论
Tunahan Keskin
Tunahan Keskin 2021-5-3
This seems to not always work.
syms z phi
simplify(2*z^2*cos(phi) + 1 - cos(phi)^2 ,'steps',100)
ans = 2*z^2*cos(phi) - cos(phi)^2 + 1
Cris LaPierre
Cris LaPierre 2021-5-3
That is correct. It will not always simplify to what you want.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by