P =((8700286382685963*x1)/9007199254740992 - (4662469420320393*x2)/18014398509481984)^2 + ((2331234710160197*x1)/9007199254740992 - (8700286382685971*x2)/9007199254740992)^2
I have a polynomial P, i want to get an expression in which this expression is approximated to 2 digits after decimal.

 採用された回答

Birdman
Birdman 2017 年 12 月 15 日

0 投票

P=vpa(P,3)

5 件のコメント

pravin behera
pravin behera 2017 年 12 月 15 日
but still here it shows the terms for which the coefficients is 1e-13. I want to remove those having very less value
Birdman
Birdman 2017 年 12 月 15 日
編集済み: Birdman 2017 年 12 月 15 日
syms x
P=135135123123*x^2/3423423652357654754635+3*x+5
P=double(sym2poly(P));
i=1:numel(P)-1;
ind=[find(P(i)>=1e-4) numel(P)];
P=poly2sym(P(ind))
This is an approach.
pravin behera
pravin behera 2017 年 12 月 15 日
it works for polynomials, but for matrix polynomials it doesnt. Is there any simple way ?
Birdman
Birdman 2017 年 12 月 15 日
I do not know. You may open a new question about it in forum.
pravin behera
pravin behera 2017 年 12 月 15 日
thanks.. your answer helped a lot

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePolynomials についてさらに検索

製品

質問済み:

2017 年 12 月 15 日

コメント済み:

2017 年 12 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by