7-2 多?式?求值、??、微??積?

nphȡAi polyval OAҦpG

Example 1: 07-hBzPR/polyval01.mp = [1 2 1]; x = 0:0.1:3; y = polyval(p, x); plot(x, y, '-o');

bWzdҤAx M y O׬ 31 VqAy(i) ȧY $p(x)= x^2+2x+1$ b x = x(i) ƭȡC

Ynp p(A)AA @}Ai polyvalm OpUG

Example 2: 07-hBzPR/polyvalm01.mp = [1 2 1]; A = [1 2; 3 4]; B = polyvalm(p, A)B = 10 14 21 31

GM B = A^2 + 2*A + 1 O@˪C

YWאּ B = polyval(p, A)Ah䵲GM B = A.^2 + 2*A + 1 O@˪C]Ъ`NGA^2 M A.^ 2 NqPAe̬Ox} A*AA̬Ox} A C@ӤC^

DhڡAi MATLAB roots OAҦpAYnph $p(x)= x^4 +3 x^3 + x^2 + 5x - 1$ ڡAiUCdҡG

Example 3: 07-hBzPR/roots01.mp = [1, 3, 1, 5, -1]; % h r = roots(p) % Dhr = -3.2051 0.0082 + 1.2862i 0.0082 - 1.2862i 0.1886

Ҧ|ڬh $p(x)$ ѡAiJpUG

Example 4: 07-hBzPR/roots02.mp = [1, 3, 1, 5, -1]; % h r = roots(p); % Dh polyval(p, r) % NڱaJhDans = 1.0e-014 * 0.3109 0.3553 - 0.3887i 0.3553 + 0.3887i 0

WzGܱN|ӮڱaJhDȪGAD`sC

Hint
fzero OiΩ@ƪDڡA@u@ӮڡAҥΪkOykCroots OuΩhDڡA@ڡAҥΪkONhܦuHx}v]Companion Matrix^AAθѯSxȪkӨDڡC

MATLAB polyder OiΩhLAҦpG

Example 5: 07-hBzPR/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᪺wg polyint OAHKhinAҦp

Example 6: 07-hBzPR/polyint02.mp = [4 3 2 1]; k = 8; % n᪺w` q = polyint(p, k) % n᪺hq = 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]Ъ`NAbڭ̰]n᪺w`Ƭ kC^

MATLAB 5.x õLhnOAڭ̥iHܧ֪Ψ䥦kFnتAҦpG

Example 7: 07-hBzPR/polyint01.mp = [4 3 2 1]; t = length(p):-1:1; k = 8; % n᪺w` q = [p./t, k] % n᪺hq = 1 1 1 1 8

HUCXpϥ MATLAB ӶihDȡBDڡBLBnG

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) nA䤤 k N`
q = [p./length(p):-1:1, k] PW@C]polyint OsbɪNס^


MATLAB{]pGig