How to approximate polynomial?

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.

 Accepted Answer

P=vpa(P,3)

5 Comments

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 on 15 Dec 2017
Edited: Birdman on 15 Dec 2017
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.
it works for polynomials, but for matrix polynomials it doesnt. Is there any simple way ?
I do not know. You may open a new question about it in forum.
thanks.. your answer helped a lot

Sign in to comment.

More Answers (0)

Categories

Products

Community Treasure Hunt

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

Start Hunting!