フィルターのクリア

Collect the term with certain order

2 ビュー (過去 30 日間)
zongquan
zongquan 2014 年 10 月 17 日
コメント済み: Star Strider 2014 年 10 月 17 日
Dear Everyone,
I have an extremely complicated multi-variablespolynomial expression.
For example,
z = a1 * x^2 + b1 * y^2 + c1* x^2 * y^2 + a2 * x^4 .....
I want to collect the coefficients of x^2, which is a1.
Everytime I use collect(z,x^2), it just returns a1*x^2 + c1* x^2* y^2 + a2 * x^4.
Does anyone have experience in extracting the exact term using collect function in Matlab?
Thanks,
Zongquan

採用された回答

Star Strider
Star Strider 2014 年 10 月 17 日
See if:
[C, T] = coeffs(z, [x y]);
does what you want. The coefficients are in ‘C’ and the corresponding terms in ‘T’.

その他の回答 (1 件)

zongquan
zongquan 2014 年 10 月 17 日
It works. Thank you, Star
  1 件のコメント
Star Strider
Star Strider 2014 年 10 月 17 日
My pleasure!

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by