sin(x)^2
古いコメントを表示
How to expand a function like sin(x)^2 to output 1/2*(1-cos(2*x))? I tried expand(sin(x)^2) but it returns the same.
採用された回答
その他の回答 (2 件)
Hose Orlando
2020 年 8 月 3 日
0 投票
how do i put this matrix into matlab ![]()
1 件のコメント
Walter Roberson
2020 年 8 月 3 日
syms A B C
[sin(A)^2, sin(B)^2, sin(C)^2
cos... etc
Perhaps the following lines will be useful:
syms x; % Establishing 'x' as a symbolic variable
combine(sin(x)^2,'sincos') % For the 1st (original) question
combine(sin(x)^3,'sincos') % For the last question
1 件のコメント
Note that combine is a useful tool, but one we see mentioned here rarely. So...
help sym/combine
カテゴリ
ヘルプ センター および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!