DSPRelated.com
Free Books

Factoring Polynomials in Matlab

Let's find all roots of the polynomial

$\displaystyle p(x) = x^5 + 5x + 7.
$

>> % polynomial = array of coefficients in matlab:
>> p = [1 0 0 0 5 7]; %  p(x) = x^5 + 5*x + 7
>> format long;       %  print double-precision
>> roots(p)           %  print out the roots of p(x)

ans =
  1.30051917307206 + 1.10944723819596i
  1.30051917307206 - 1.10944723819596i
 -0.75504792501755 + 1.27501061923774i
 -0.75504792501755 - 1.27501061923774i
 -1.09094249610903


Next Section:
Geometric Signal Theory
Previous Section:
Complex Numbers in Matlab and Octave