'simplify' expression not efficient in Matlab2015
1 次查看(过去 30 天)
显示 更早的评论
I used Matlab 2015 to simplify an trigonometric expression, but in vain. It is not able to replace 1-sin^2() with cos^2(). If my memory serves correctly, Matlab2014 was able to do this very efficiently.
Is there a new function that does this in 2015, or we just lost a great feature.
Edit: Inserted Picture
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/155515/image.png)
0 个评论
回答(1 个)
Walter Roberson
2016-2-21
syms theta
simplify( 1 - sin(theta)^2 )
2 个评论
Star Strider
2016-2-21
In R2015b:
syms theta
q1 = simplify(1 - sin(theta)^2, 'steps', 10)
q2 = rewrite(1 - sin(theta)^2, 'cos')
q1 =
cos(theta)^2
q2 =
cos(theta)^2
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!