1.计算572396a与864142b的数组乘积a=[693;275];b=[241;468];a.*bans=12363842402.对于BAX,如果753467294A,282637B,求解X。A=[492;764;357];B=[372628]’;X=A\BX=-0.51184.04271.33183.463521a,263478b,观察a与b之间的六种关系运算的结果a=[123;456];b=[8–74;362];abans=010101a=bans=010101abans=101010a=bans=101010a==bans=000000a~=bans=1111114计算多项式乘法(x2+2x+2)(x2+5x+4)c=conv([122],[154])c=17161885计算多项式除法(3x3+13x2+6x+8)/(x+4)d=deconv([31368],[14])d=3126求欠定方程组5865394742x的最小范数解a=[2474;9356];b=[85]';x=pinv(a)*bx=-0.21510.44590.79490.27077用符号函数法求解方程at2+b*t+c=0r=solve('a*t^2+b*t+c=0','t')r=[1/2/a*(-b+(b^2-4*a*c)^(1/2))][1/2/a*(-b-(b^2-4*a*c)^(1/2))]8求矩阵22211211aaaaA的行列式值、逆和特征根symsa11a12a21a22;A=[a11,a12;a21,a22]AD=det(A)%行列式AI=inv(A)%逆AE=eig(A)%特征值A=[a11,a12][a21,a22]AD=a11*a22-a12*a21AI=[-a22/(-a11*a22+a12*a21),a12/(-a11*a22+a12*a21)][a21/(-a11*a22+a12*a21),-a11/(-a11*a22+a12*a21)]AE=[1/2*a11+1/2*a22+1/2*(a11^2-2*a11*a22+a22^2+4*a12*a21)^(1/2)][1/2*a11+1/2*a22-1/2*(a11^2-2*a11*a22+a22^2+4*a12*a21)^(1/2)]9因式分解:6555234xxxxsymsx;f=x^4-5*x^3+5*x^2+5*x-6;factor(f)ans=(x-1)*(x-2)*(x-3)*(x+1)10)sin()log(12xxexxafax,用符号微分求df/dx。symsax;f=[a,x^2,1/x;exp(a*x),log(x),sin(x)];df=diff(f)df=[0,2*x,-1/x^2][a*exp(a*x),1/x,cos(x)]11求.arctan2xdxx和.)(102dxxx程序如下:symsx;int(x^2*atan(x),'x')ans=1/3*x^3*atan(x)-1/6*x^2+1/6*log(x^2+1)simple(ans)结果如下:ans=1/3*x^3*atan(x)-1/6*x^2+1/6*log(x^2+1)--------程序如下:symsx;int(x-x^2,'x',0,1)结果如下:ans=1/612微分方程xeyyyx2cos52的通解.程序如下:symsxy;dsolve('D2y-2*Dy+5*y=exp(x)*cos(2*x)')ans=exp(t)*sin(2*t)*C2+exp(t)*cos(2*t)*C1+1/5*exp(x)*cos(2*x)13求代数方程组002yxcbyax关于x,y的解S=solve('a*x^2+b*y+c=0','b*x+c=0','x','y');disp('S.x='),disp(S.x)disp('S.y='),disp(S.y)S.x=-c/bS.y=-c*(a*c+b^2)/b^314求方程组.0532,0375,023,02432143243214321xxxxxxxxxxxxxxx和53323221242143143214321xxxxxxxxxxxxxx程序如下:a1=[11-2-1];a2=[3-1-12];a3=[0573];a4=[2-3-5-1];linsolve([a1;a2;a3;a4],[0000]')ans=0000该方程组无解.-------程序如下:a1=[1-121];a2=[2-112];a3=[10-11];a4=[3-103];null([a1;a2;a3;a4],'r')ans=1-1301001所以该方程组的通解为:(其中k1k2为任意常数)15符号函数绘图法绘制函数x=sin(3t)cos(t),y=sin(3t)sin(t)的图形,t的变化范围为[0,2]symstezplot(sin(3*t)*cos(t),sin(3*t)*sin(t),[0,2*pi])16有一组测量数据满足-atey,t的变化范围为0~10,用不同的线型和标记点画出a=0.1、a=0.2和a=0.5三种情况下的曲线,并加入标题和图列框(用代码形式生成)t=0:0.5:10;y1=exp(-0.1*t);y2=exp(-0.2*t);y3=exp(-0.5*t);plot(t,y1,'-ob',t,y2,':*r',t,y3,'-.^g')title('\ity\rm=e^{-\itat}','FontSize',12)legend('a=0.1','a=0.2','a=0.5')17x=[6649715638],绘制饼图并将第五个切块分离x=[6649715638];L=[00001];pie(x,L)1822yxxez,当x和y的取值范围均为-2到2时,用建立子窗口的方法在同一个图形窗口中绘制出三维线图、网线图、表面图和带渲染效果的表面图[x,y]=meshgrid([-2:.2:2]);z=x.*exp(-x.^2-y.^2);mesh(x,y,z)subplot(2,2,1),plot3(x,y,z)title('plot3(x,y,z)')subplot(2,2,2),mesh(x,y,z)title('mesh(x,y,z)')subplot(2,2,3),surf(x,y,z)title('surf(x,y,z)')subplot(2,2,4),surf(x,y,z),shadinginterptitle('surf(x,y,z),shadinginterp')19在区间]1,1[画出函数xy1sin的图形程序如下:fplot('sin(1/x)',[-pi/12,pi/12])gridtitle('graphofsin(1/x)')结果如下:-0.25-0.2-0.15-0.1-0.0500.050.10.150.20.25-1-0.8-0.6-0.4-0.200.20.40.60.81graphofsin(1/x)20分别画出坐标为)10,,2,1(),4,(),,(3222iiiiii的散点图,并画出折线图程序如下:fori=1:10plot(i,i.^2,'.');holdonplot(i.^2,4*i.^2+i.^3,'.');endx=1:10;y=x.^2;plot(x,y);plot(x.^2,4*x.^2+x.^3);axis([0,105,0,1450])结果如下:0102030405060708090100020040060080010001200140021在区间]4,4[上作出函数xxxxxf339)(的图形,并计算)(limxfx和).(lim1xfx程序如下:symsx;f=(x^3-9*x)/(x^3-x);limit(f,x,inf)ans=1limit(f,x,1)ans=NaN绘制()fx的图形程序如下:f=inline('(x.^3-9*x)./(x.^3-x)');x=-4:0.01:4;plot(x,f(x))-4-3-2-101234-400-300-200-100010020030040050022求函数bxaxxfcossin)(的一阶导数.并求.1baf程序如下:symsxab;f=sin(a*x)*cos(b*x);diff(f)ans=cos(a*x)*a*cos(b*x)-sin(a*x)*sin(b*x)*bsimple(ans)ans=cos(a*x)*a*cos(b*x)-sin(a*x)*sin(b*x)*bg=inline('cos(a*x)*a*cos(b*x)-sin(a*x)*sin(b*x)*b');g(a,b,1/(a+b))ans=cos(a/(a+b))*a*cos(b/(a+b))-sin(a/(a+b))*sin(b/(a+b))*b