MATLAB: How to find the root of a polynomial

polynomial root

I have this polynomial: P(z) = z.^9 + z.^8 – z.^7 + z.^6 – z.^5 + z + 1
And I'd like to find the roots for it.
How would I go about doing that?

Best Answer

Easiest:
syms z
P(z) = z.^9 + z.^8 - z.^7 + z.^6 - z.^5 + z + 1;
rts = vpasolve(P)
Otherwise:
rts = roots([1 1 -1 1 -1 0 0 0 1 1]);
With the same essential result.