ps5solnsF06

# ps5solnsF06 - %Engineering 6, Fall 2006, Problem 5.1...

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

%Engineering 6, Fall 2006, Problem 5.1 Solution %(Polynomial exercises) %Suppress extra lines in output and set fixed short display format compact ; format short ; clc; %Clear command window clear; %Clear variables %Part (a) a = [4 0 -11 6 -10]; b = [6 0 4]; c = conv(a,b); fprintf( 'Part (a)\nThe coefficients of the product polynomial are:\n' ); fprintf( '%6.0f' ,c); fprintf( '\n' ); %Blank line %Part (b) deriv_c = polyder(c); %Could also write: deriv_c = polyder(a,b) fprintf( '\nPart (b)\nThe coefficients of the derivative of the product polynomial are:\n' ); fprintf( '%6.0f' ,deriv_c); fprintf( '\n' ); %Blank line %Part (c) %Define numerator and denominator coefficient vectors n = [3 12 -23 14]; d = [9 3 4]; %Calculate quotient and remainder coefficients [q r] = deconv(n,d); fprintf( '\nPart (c)\nThe quotient coefficients are:\n' ); fprintf( '%8.2f' ,q); fprintf( '\nAnd the remainder coefficients are:\n' ); fprintf( '%8.2f' ,r); fprintf( '\n' ); %Blank line %Part (d) %Define roots vector r = [2 6 8 -3+5j -3-5j]; %Calculate the polynomial coefficients e = poly(r); fprintf( '\nPart (d). Given the specified roots, the polynomial coefficients are:\n' ); fprintf( '%8.1f' ,e); %Find the roots of the polynomial defined by e %Note that the fprintf function only displays the real part of complex numbers, %so to get the complete numbers displayed we have to set up an array with %the real parts of the roots in the first row and the imaginary parts in the %second row. Then we fprintf the array (named T below). (The "i" in the "%4.1fi" is

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/22/2011 for the course ENG 006 taught by Professor Lagerstrom during the Fall '06 term at UC Davis.

### Page1 / 6

ps5solnsF06 - %Engineering 6, Fall 2006, Problem 5.1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online