Polynomial roots

The `roots`

function solves polynomial
equations of the form $${p}_{1}{x}^{n}+\mathrm{...}+{p}_{n}x+{p}_{n+1}=0$$.
Polynomial equations contain a single variable with nonnegative exponents.
To find the roots of other types of equations, use `fzero`

.

`r = roots(p)`

example

`r = roots(`

returns
the roots of the polynomial represented by `p`

)`p`

as
a column vector.

`p`

is a vector containing `n+1`

polynomial
coefficients, starting with the coefficient of *x*^{n}.
A coefficient of `0`

indicates an intermediate power
that is not present in the equation. For example, ```
p = [3
2 -2]
```

represents the polynomial $$3{x}^{2}+2x-2$$.

Was this topic helpful?