Topic 10.5: Polynomials (Matlab)

Contents Previous Chapter Start of Chapter Previous Topic Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple Next Topic Next Chapter

The function roots finds the roots of a polynomial:

>> p = [1 2 3];
>> roots( p )
ans =
  -1.00000 + 1.41421i
  -1.00000 - 1.41421i

>> p = [1 2 3 4 5 6];
>> roots( p )        
ans =
   0.55169 + 1.25335i
   0.55169 - 1.25335i
  -0.80579 + 1.22290i
  -0.80579 - 1.22290i
  -1.49180 + 0.00000i

Note that the second polynomial, of odd degree, has one real root.

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.