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일

2 개 추천

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일
I didn't know this existed, thank you.
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개)

제품

릴리스

R2020b

태그

질문:

2021년 5월 3일

댓글:

2021년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by