1、 p1=1,8,0,0,-10; % x4+8x3-10 p2=2,-1,3; % 2x2-x+3 conv(p1,p2)ans =2 15 -5 24 -20,多项式乘法,多项式除法 Q,r=deconv(p1,p2)Q =0.5000 4.2500 1.3750 %商式r =0 0 0 -11.3750 -14.1250 %余式, a = 1 2 3; b = 4 5 6; c = conv(a,b)c =4 13 28 27 18, v=3 5 2 1 4; u=2 5 3; q,r=deconv(v,u) conv(q,u)+r result=deconv(v,u)q =1.5000
2、-1.2500 1.8750r =0 0 0 -4.6250 -1.6250ans =3 5 2 1 4result =1.5000 -1.2500 1.8750, p=1; q=1,0,5; p,q=polyder(p,q) p =-2 0q =1 0 10 0 25, a=3,5,7,2; b=4,3,1; polyder(a) polyder(a,b) q,d=polyder(a,b)ans =9 10 7ans =60 116 138 68 13q =12 18 -4 -6 1d =16 24 17 6 1, p=1,0,-1,2,-1;%向量形式 poly2sym(p)%符号形式an
3、s =x4-x2+2*x-1 polyval(p,0)多项式求值ans =-1, s=3 5 -4 2; a=2.7; polyval(s,a) 3*a*a*a+5*a*a-4*a+2ans =86.6990ans =86.6990,多项式求根 roots(p)ans =-1.6180 0.5000 + 0.8660i0.5000 - 0.8660i0.6180, p = 1 -6 -72 -27; r = roots(p)r =12.1229-5.7345-0.3884, s=1 5 -2 5 r=roots(s) ss=poly(r)s =1 5 -2 5r =-5.5257 0.2629
4、 + 0.9142i0.2629 - 0.9142iss =1.0000 5.0000 -2.0000 5.0000,多项式微分, a=1 2 3 4 5; poly2str(a,x)ans =x4 + 2 x3 + 3 x2 + 4 x + 5 b=polyder(a)b =4 6 6 4 poly2str(b,x)ans =4 x3 + 6 x2 + 6 x + 4, a=1 3 2; b=1 -3 2; p=conv(a,b) x=-3:0.2:3; y=polyval(p,x); ys=y+randn(size(y); pp=polyfit(x,ys,4) ypp=polyval(pp,x); plot(x,y,x,ys,o,x,ypp,-.) grid onp =1 0 -5 0 4pp =1.0033 -0.0131 -5.0077 0.1659 3.9978,