symbolic of cos with power
3 次查看(过去 30 天)
显示 更早的评论
I have a long equation with cosine with powers (e.g., (cos(a))^3, (cos(a))^5, ..). Then I need to reduce each power of cosine to unity (but angle is higher): e.g., (cos(a))^2 -> (1+cos(2a))/2.
Here are more examples which reduce various powers:
Anyone who knows how to reduce my cosines to unity of power of cosine, using symbolic of matlab?
回答(1 个)
Karan Gill
2016-12-9
Here, you want to change the input of "cos" from "x" to "2*x". Essentially, you want make the argument of "cos" more complicated. The "combine" command does that.
syms x
f = cos(x)^2;
combine(f,'sincos')
ans =
cos(2*x)/2 + 1/2
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!