15-3 ?件?方?

`Φbhާ@]tDȡBDڡBLBnAoǾާ@ڭ̳iHݦOh󪺤k]Methods^AC@Ӥk @polynom ؿU@Ө禡CӥBoǨ禡uΩڭ̩ҩwqhC

@ӳ²檺kANOnΦh󪺫YơAiHaUC禡ӧG

Example 1: 15-ɦV{]p/@polynom/polyCoef.mfunction c = polyCoef(p) % POLYNOM/POLYCOEF Convert polynom object to coefficient vector. c = p.c;

gѦ禡]Τk^A~@ɤ~o@Ӧh󪺫YơC

YnphȡAڭ̥iHĥΤUC禡G

Example 2: 15-ɦV{]p/@polynom/polyval.mfunction y = polyval(p, x) % POLYNOM/POLYVAL POLYVAL(p, x) evaluates p at the points x. y = polyval(p.c, x);

bWz禡Aڭ̪Is MATLAB 즳禡 polyval ӭphȡAM禡W٤@ˡA MATLAB ھڸƫAPөIsP禡Ao]Oݩ禡\઺{CզkAШUҽdҡG

Example 3: 15-ɦV{]p/polyval01.mp = polynom([1 2 3]); x = polyval(p, 1) y = polyval(p, [1 2 3 4])x = 6 y = 6 11 18 27

Hint
bWzdҤAMATLAB ĥ y = polyval(p, [1 2 3 4]) 覡өIsh p kpolyvalAb@䴩OOP{y]p C++ JavaScript^AIs覡ӬO y = p.polyval([1 2 3 4])AȨѰѦҤC

Q覡Aڭ̤]iHDhڡ]roots.m^BL]polyder.m^Bn]polyint.m^AoǨ禡wgm @polynom ؿUAŪ̥iHۦiդιC

t@ӱ`Ϊ\ANOheϡAoiѤUC plot.m 禡ӹFG

Example 4: 15-ɦV{]p/@polynom/plot.mfunction plot(p, range) % POLYNOM/PLOT PLOT(p) plots the polynom p. if nargin<2 range = max(abs(roots(p)))*[-1 1]; end x = linspace(range(1), range(2)); y = polyval(p, x); plot(x, y); title(polyAsString(p)) grid on

bWz禡Arange OyI@ϪdAYwA禡]|۰ʨMw@ӽdӶi@ϡCHUdҥiΨӴզ plot 禡G

Example 5: 15-ɦV{]p/polyPlot01.mp = polynom([1 -4 -1 4]); range = [-1.2, 4.2]; subplot(3,1,1); plot(p, range); p2 = polyder(p); subplot(3,1,2); plot(p2, range); p3 = polyder(p2); subplot(3,1,3); plot(p3, range);

bWzdҤAĤ@ӹϬOh b [-1.2, 4.2] ϶uϡAĤGBTӹϤOO @MGɨƪϡC

pGAnܤ@OҦkAiHϥ methods OAҦppGAb MATLAB ROJumethods polynomvANiHݨ polynom Ҿ֦UؤkC


MATLAB{]pGig