15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Polynomials<br />

Polynomial Function Summary (Continued)<br />

Function<br />

polyvalm<br />

residue<br />

roots<br />

Description<br />

Matrix polynomial evaluation.<br />

Partial-fraction expansion (residues).<br />

Find polynomial roots.<br />

The Symbolic Math Toolbox contains additional specialized support for<br />

polynomial operations.<br />

Representing Polynomials<br />

<strong>MATLAB</strong> represents polynomials as row vectors containing coefficients<br />

ordered by descending powers. For example, consider the equation<br />

px ( ) = x 3 – 2x – 5<br />

This is the celebrated example Wallis used when he first represented Newton’s<br />

method to the French Academy. To enter this polynomial into <strong>MATLAB</strong>, use<br />

p = [1 0 -2 -5];<br />

Polynomial Roots<br />

The roots function calculates the roots <strong>of</strong> a polynomial:<br />

r = roots(p)<br />

r =<br />

2.0946<br />

-1.0473 + 1.1359i<br />

-1.0473 - 1.1359i<br />

By convention, <strong>MATLAB</strong> stores roots in column vectors. The function poly<br />

returns to the polynomial coefficients:<br />

p2 = poly(r)<br />

p2 =<br />

1 8.8818e-16 -2 -5<br />

2-3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!