How to make a polynomial with negative power?

10 views (last 30 days)
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
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
Walter Roberson on 27 Jan 2017
roots() cannot be applied to symbolic polynomials. You can solve() such a system but not roots() it

Sign in to comment.

Answers (3)

KSSV
KSSV on 12 Oct 2016
Let x = 1/z then your polynomial will be 0.9-2.2x+2.2x^2.
  3 Comments
KSSV
KSSV on 12 Oct 2016
x = roots([.9, -2.2, 2.2]) ;
reciprocal of x are your required polynomial roots.
Walter Roberson
Walter Roberson on 12 Oct 2016
No! The roots are the same, not the recipricals!

Sign in to comment.


Andrei Bobrov
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

Walter Roberson
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.

Community Treasure Hunt

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

Start Hunting!