{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

This preview shows pages 1–3. Sign up to view the full content.

Roots of Polynomials Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition A 3 Copyright © Orchard Publications One of the most powerful features of MATLAB is the ability to do computations involving com- plex numbers . We can use either , or to denote the imaginary part of a complex number, such as 3-4i or 3-4j . For example, the statement z=3 4j displays z = 3.0000 4.0000i In the above example, a multiplication (*) sign between 4 and was not necessary because the complex number consists of numerical constants. However, if the imaginary part is a function, or variable such as , we must use the multiplication sign, that is, we must type cos(x)*j or j*cos(x) for the imaginary part of the complex number. A.3 Roots of Polynomials In MATLAB, a polynomial is expressed as a row vector of the form . These are the coefficients of the polynomial in descending order. We must include terms whose coeffi- cients are zero . We find the roots of any polynomial with the roots(p) function; p is a row vector containing the polynomial coefficients in descending order. Example A.1 Find the roots of the polynomial Solution: The roots are found with the following two statements where we have denoted the polynomial as p1, and the roots as roots_ p1. p1=[1 10 35 50 24] % Specify and display the coefficients of p1(x) p1 = 1 - 10 35 - 50 24 roots_ p1=roots(p1) % Find the roots of p1(x) roots_p1 = 4.0000 3.0000 2.0000 1.0000 i j j x ( ) cos a n a n 1 a 2 a 1 a 0 [ ] p 1 x ( ) x 4 10x 3 35x 2 50x 24 + + =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Appendix A Introduction to MATLAB® A 4 Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition Copyright © Orchard Publications We observe that MATLAB displays the polynomial coefficients as a row vector, and the roots as a column vector. Example A.2 Find the roots of the polynomial Solution: There is no cube term; therefore, we must enter zero as its coefficient. The roots are found with the statements below, where we have defined the polynomial as p2, and the roots of this polyno- mial as roots_ p2. The result indicates that this polynomial has three real roots, and two complex roots. Of course, complex roots always occur in complex conjugate * pairs. p2=[1 7 0 16 25 52] p2 = 1 -7 0 16 25 52 roots_ p2=roots(p2) roots_p2 = 6.5014 2.7428 -1.5711 -0.3366 + 1.3202i -0.3366 - 1.3202i A.4 Polynomial Construction from Known Roots We can compute the coefficients of a polynomial, from a given set of roots, with the poly(r) func- tion where r is a row vector containing the roots.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}