Symbolic collect and display

34 ビュー (過去 30 日間)
Ole
Ole 2019 年 8 月 31 日
コメント済み: Star Strider 2019 年 8 月 31 日
I would lie to display the coefficients before the expansion terms of the cos one by one.
syms x y
f = expand(sin(x + 3*y));
coeffs_cosy = collect(f, cos(y))
How can the terms before the cos^n be displayed one by one?
This is short but for more complicated expressions, several dimensions the taylor series output text that cannot be displayed.

採用された回答

Star Strider
Star Strider 2019 年 8 月 31 日
I am not certain what result you want.
Try this:
[cfs,trm] = coeffs(coeffs_cosy, cos(y))
producing:
cfs =
[ 4*sin(x), 4*cos(x)*sin(y), -3*sin(x), -cos(x)*sin(y)]
trm =
[ cos(y)^3, cos(y)^2, cos(y), 1]
Experiment with the coeffs arguments to get the result you want.
  2 件のコメント
Ole
Ole 2019 年 8 月 31 日
Thank you.
Star Strider
Star Strider 2019 年 8 月 31 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by