7-2 hDÈ¡BDÚ¡BLPn

­n­pºâ¦h¶µ¦¡ªº­È¡A¥i¥Î polyval «ü¥O¡A¨Ò¦p¡G

Example 1: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/polyval01.mp = [1 2 1]; x = 0:0.1:3; y = polyval(p, x); plot(x, y, '-o');

¦b¤W­z½d¨Ò¤¤¡Ax ©M y ³£¬Oªø«×¬° 31 ªº¦V¶q¡Ay(i) ªº­È§Y¬° $p(x)= x^2+2x+1$ ¦b x = x(i) ªº¨ç¼Æ­È¡C

­Y­n­pºâ p(A)¡AA ¬°¤@¤è°}¡A¥i¥Î polyvalm «ü¥O¦p¤U¡G

Example 2: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/polyvalm01.mp = [1 2 1]; A = [1 2; 3 4]; B = polyvalm(p, A)B = 10 14 21 31

¦¹µ²ªG©M B = A^2 + 2*A + 1 ¬O¤@¼Ëªº¡C

­Y¤W¦¡§ï¬° B = polyval(p, A)¡A«h¨äµ²ªG©M B = A.^2 + 2*A + 1 ¬O¤@¼Ëªº¡C¡]½Ðª`·N¡GA^2 ©M A.^ 2 ªº·N¸q§¹¥þ¤£¦P¡A«eªÌ¬O¯x°} A*A¡A«áªÌ¬O¹ï¯x°} A ªº¨C¤@­Ó¤¸¯À¥­¤è¡C¡^

±ý¨D¦h¶µ¦¡ªº®Ú¡A¥i¥Î MATLAB ªº roots «ü¥O¡A¨Ò¦p¡A­Y­n­pºâ¦h¶µ¦¡ $p(x)= x^4 +3 x^3 + x^2 + 5x - 1$ ªº®Ú¡A¥i¨£¤U¦C½d¨Ò¡G

Example 3: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/roots01.mp = [1, 3, 1, 5, -1]; % ¦h¶µ¦¡ r = roots(p) % ¨D¦h¶µ¦¡ªº®Úr = -3.2051 0.0082 + 1.2862i 0.0082 - 1.2862i 0.1886

±ýÅçÃÒ¦¹¥|®Ú¬°¦h¶µ¦¡ $p(x)$ ªº¸Ñ¡A¥i¿é¤J¦p¤U¡G

Example 4: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/roots02.mp = [1, 3, 1, 5, -1]; % ¦h¶µ¦¡ r = roots(p); % ¨D¦h¶µ¦¡ªº®Ú polyval(p, r) % ±N®Ú±a¤J¦h¶µ¦¡¨D­Èans = 1.0e-014 * 0.3109 0.3553 - 0.3887i 0.3553 + 0.3887i 0

¤W­zµ²ªGÅã¥Ü±N¥|­Ó®Ú±a¤J¦h¶µ¦¡¨D­Èªºµ²ªG¡A³£«D±`±µªñ©ó¹s¡C

Hint
fzero «ü¥O¥i¥Î©ó¤@¯ë¨ç¼Æªº¨D®Ú¡A¦ý¥¦¤@¦¸¥u¯à§ä¨ì¤@­Ó®Ú¡A©Ò¥Îªº¤èªk¬O¤û¹yªk¡Croots «ü¥O¥u¯à¥Î©ó¦h¶µ¦¡ªº¨D®Ú¡A¥¦¯à¤@¦¸§ä¨ì¥þ³¡ªº®Ú¡A©Ò¥Îªº¤èªk¬O¥ý±N¦h¶µ¦¡ªí¥Ü¦¨¡u¦ñÀH¯x°}¡v¡]Companion Matrix¡^¡A¦A¥Î¸Ñ¯S¼x­Èªº¤èªk¨Ó¨D®Ú¡C

MATLAB ªº polyder «ü¥O¥i¥Î©ó¦h¶µ¦¡ªº·L¤À¡A¨Ò¦p¡G

Example 5: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/polyder01.mp = [1 3 3 1]; q = polyder(p)q = 3 6 3

¦¹§Yªí¥Ü $p(x)= x^3 +3x^2 + 3x + 1$ ·L¤À«áªºµ²ªG¬° $q(x) = 3x^2 + 6x + 3$¡C

MATLAB 6.x ¥H«áªºª©¥»¤w¸g´£¨Ñ polyint «ü¥O¡A¥H«K¹ï¦h¶µ¦¡¶i¦æ¿n¤À¡A¨Ò¦p

Example 6: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/polyint02.mp = [4 3 2 1]; k = 8; % ¿n¤À«áªº¤£©w±`¼Æ q = polyint(p, k) % ¿n¤À«áªº¦h¶µ¦¡q = 1 1 1 1 8

¦¹§Yªí¥Ü $p(x)= 4x^3 +3x^2 + 2x + 1$ ¿n¤À«áªºµ²ªG¬° $q(x) = x^4 + x^3 + x^2 + x + 8$¡C¡]½Ðª`·N¡A¦b¦¹§Ú­Ì°²³]¿n¤À«áªº¤£©w±`¼Æ¬° k¡C¡^

MATLAB 5.x ¨ÃµL¹ï¦h¶µ¦¡¿n¤Àªº«ü¥O¡A¦ý§Ú­Ì¥i¥H«Ü§Öªº¥Î¨ä¥¦¤èªk¹F¦¨¿n¤Àªº¥Øªº¡A¨Ò¦p¡G

Example 7: 07-¦h¶µ¦¡ªº³B²z»P¤ÀªR/polyint01.mp = [4 3 2 1]; t = length(p):-1:1; k = 8; % ¿n¤À«áªº¤£©w±`¼Æ q = [p./t, k] % ¿n¤À«áªº¦h¶µ¦¡q = 1 1 1 1 8

¥H¤U¦C¥X¦p¦ó¨Ï¥Î MATLAB ¨Ó¶i¦æ¦h¶µ¦¡ªº¨D­È¡B¨D®Ú¡B·L¤À¡B¿n¤À¡G

¨ç¼Æ »¡©ú
q = polyval(p, x) ­pºâ p(x) ªº­È
q = polyvalm(a, A) ­pºâ p(A)¡AA ¬°¤@¤è°}
r = roots(p) ­pºâ p(x) ªº®Ú
q = polyder(p) q(x) ¬° p(x) ªº·L¤À
q = polyint(p, k) q(x) ¬° p(x) ªº¿n¤À¡A¨ä¤¤ k ¬°¥ô·N±`¼Æ
q = [p./length(p):-1:1, k] ¦P¤W¤@¦C¡]polyint «ü¥O¤£¦s¦b®Éªº´À¥N¤è®×¡^


MATLABµ{¦¡³]­p¡G¶i¶¥½g