Factoring Polynomials in Matlab Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

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  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work] [Order a printed hardcopy]

``Mathematics of the Discrete Fourier Transform (DFT), with Music and Audio Applications'', by Julius O. Smith III, W3K Publishing, 2003, ISBN 0-9745607-0-7.
Copyright © 2007-02-02 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  [Automatic-links disclaimer]