フィルターのクリア

what is the difference between sym2poly and coeffs?

9 ビュー (過去 30 日間)
Li
Li 2013 年 5 月 30 日
It seems them get a different vector elements order.... Anyone tell me the concrete distinction? thks!

回答 (2 件)

David Sanchez
David Sanchez 2013 年 5 月 30 日
sym2poly is used when symbolic notation is used. Both return the coefficients of a polynomial.
You can read the help of each one to see the slight difference between them through the examples therein provided.
help sym2poly
help coeffs
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 30 日
they do not return the same result

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


Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 30 日
編集済み: Azzi Abdelmalek 2013 年 5 月 30 日
syms x u
%first example
y=x^3 - 2*x - 5
sym2poly(y) % considere y as a polynome
ans =
1 0 -2 -5
coeffs(y) % considere y as any expression
ans =
[ -5, -2, 1] % the coefficient 0 is omitted
% second example
y=x^2+3*u^3+25
coeffs(y)
ans =
[ 25, 1, 3]
sym2poly(y)
Error using sym/sym2poly (line 21)
Input has more than one symbolic variable.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by