How to make a polynomial with negative power?
10 views (last 30 days)
Show older comments
Hi
I want to make a polynomial with the negative power like:
0.9 - 2.2z^(-1) + 2.2z^(-2)
The problem is i do not know how to write this in Matlab since:
p=[2.2 2.2 0.9];
p = 1/p;
won't create the polynomial
0.9 - 2.2z^(-1) + 2.2z^(-2)
Because i want to use the roots() function on it.
Hope someone has a nice solution
Cheers
2 Comments
Jay Im
on 27 Jan 2017
syms x y; p=poly2sym(p,y);%try intermediate poly expression maker subs(p,x^-1);%substitute y with 1/x
Hope this does the trick.
Walter Roberson
on 27 Jan 2017
roots() cannot be applied to symbolic polynomials. You can solve() such a system but not roots() it
Answers (3)
Andrei Bobrov
on 12 Oct 2016
z = roots([.9, -2.2, 2.2]) % here your polynomial 0.9*x^2 - 2.2*x + 2.2
0 Comments
Walter Roberson
on 12 Oct 2016
By definition, polynomials never have negative powers of the variable.
The roots of an expression that is like a polynomial but has negative powers, are the same as the roots of the expression divided by the variable to the most negative power -- which is the same as multiplying by the variable to the positive version of the most negative power to give a polynomial. For example the roots of 0.9 - 2.2z^(-1) + 2.2z^(-2) are the same as the roots of 0.9*(z^0*z^2) - 2.2 * (z^(-1)*z^2) + 2.2*(z^(-2)*z^2) which is 0.9*z^2 - 2.2 * z + 2.2
Exception: roots that are 0 must be discarded.
0 Comments
See Also
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!