您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > MATLAB实验练习题(计算机)-南邮-MATLAB-数学实验大作业答案
1“MATLAB”练习题要求:抄题、写出操作命令、运行结果,并根据要求,贴上运行图。1、求230xex的所有根。(先画图后求解)(要求贴图)solve('exp(x)-3*x^2',0)ans=-2*lambertw(-1/6*3^(1/2))-2*lambertw(-1,-1/6*3^(1/2))-2*lambertw(1/6*3^(1/2))2、求下列方程的根。1)5510xxa=solve('x^5+5*x+1',0);a=vpa(a,6)a=1.10447+1.05983*i-1.00450+1.06095*i-.199936-1.00450-1.06095*i1.10447-1.05983*i2)1sin02xx至少三个根2fzero('x*sin(x)-1/2',3)ans=2.9726fzero('x*sin(x)-1/2',-3)ans=-2.9726fzero('x*sin(x)-1/2',0)ans=-0.74083)2sincos0xxx所有根3fzero('sin(x)*cos(x)-x^2',0)ans=0fzero('sin(x)*cos(x)-x^2',0.6)ans=0.70223、求解下列各题:1)30sinlimxxxxsymx;limit((x-sin(x))/x^3)ans=1/62)(10)cos,xyexy求symx;diff(exp(x)*cos(x),10)ans=(-32)*exp(x)*sin(x)43)21/20(17xedx精确到位有效数字)symx;vpa((int(exp(x^2),x,0,1/2)),17)ans=0.544987104183622224)42254xdxxsymx;int(x^4/(25+x^2),x)ans=125*atan(x/5)-25*x+x^3/35)求由参数方程2ln1arctanxtyt所确定的函数的一阶导数dydx与二阶导数22dydx。symt;x=log(sqrt(1+t^2));y=atan(t);diff(y,t)/diff(x,t)ans=1/t6)设函数y=f(x)由方程xy+ey=e所确定,求y′(x)。symsxy;f=x*y+exp(y)-exp(1);-diff(f,x)/diff(f,y)ans=-y/(x+exp(y))57)0sin2xexdxsymsx;y=exp(-x)*sin(2*x);int(y,0,inf)ans=2/58)108xx将在展开(最高次幂为)symsxf=sqrt(1+x);taylor(f,0,9)ans=-(429*x^8)/32768+(33*x^7)/2048-(21*x^6)/1024+(7*x^5)/256-(5*x^4)/128+x^3/16-x^2/8+x/2+19)1sin(3)(2)xyey求symsxy;y=exp(sin(1/x));dy=subs(diff(y,3),x,2)dy=-0.582610)求变上限函数2xxatdt对变量x的导数。symsat;diff(int(sqrt(a+t),t,x,x^2))Warning:Explicitintegralcouldnotbefound.6ans=2*x*(x^2+a)^(1/2)-(a+x)^(1/2)4、求点(1,1,4)到直线L:31102xyz的距离M0=[1,1,4];M1=[3,0,1];M0M1=M1-M0;v=[-1,0,2];d=norm(cross(M0M1,v))/norm(v)d=1.09545、已知22()21(),2xfxe分别在下列条件下画出()fx的图形:(要求贴图)(1)1,011时=,-,,在同一坐标系里作图symsx;fplot('(1/sqrt(2*pi))*exp(-((x)^2)/2)',[-3,3],'r')holdonfplot('(1/sqrt(2*pi))*exp(-((x-1)^2)/2)',[-3,3],'y')holdonfplot('(1/sqrt(2*pi))*exp(-((x+1)^2)/2)',[-3,3],'g')holdoff(2)0,124=时=,,,在同一坐标系里作图。symsx;fplot('(1/sqrt(2*pi))*exp(-((x)^2)/2)',[-3,3],'r')holdon7fplot('(1/(sqrt(2*pi)*2))*exp(-((x)^2)/(2*2^2))',[-3,3],'y')holdonfplot('(1/(sqrt(2*pi)*4))*exp(-((x)^2)/(2*4^2))',[-3,3],'g')holdoff6、画下列函数的图形:(要求贴图)(1)sin020cos024xuttyututzezmesh('u*sin(t)','u*cos(t)','t/4',[0,20,0,2])(2)sin()03,03zxyxyx=0:0.1:3;y=x;[XY]=meshgrid(x,y);Z=sin(X*Y);mesh(X,Y,Z)8(3)sin(3cos)02cos(3cos)02sinxtutytuuzuezmesh('sin(t)*(3+cos(u))','cos(t)*(3+cos(u))','sin(u)',[0,2*pi,0,2*pi])7、已知422134305,203153211AB,在MATLAB命令窗口中建立A、B矩阵并对其进行以下操作:(1)计算矩阵A的行列式的值det()AA=[4,-2,2;-3,0,5;1,5,3];det(A)ans=-158(2)分别计算下列各式:1122,*,.*,,,,TABABABABABAA9A=[4,-2,2;-3,0,5;1,5,3];B=[1,3,4;-2,0,-3;2,-1,1];2*A-Bans=7-70-40130115A*Bans=1210247-14-7-30-8A.*Bans=4-6860-152-53A*inv(B)ans=-0.0000-0.00002.0000-2.7143-8.0000-8.14292.42863.00002.2857inv(A)*Bans=0.48730.41141.00000.3671-0.43040.0000-0.10760.24680.0000A*Aans=102424-7319-81336A'ans=4-31-2052538、在MATLAB中分别利用矩阵的初等变换及函数rank、函数inv求下列矩阵的秩:(1)16323540,11124A求rank(A)=?A=[1,-6,3,2;3,-5,4,0;-1,-11,2,4];rank(A)ans=3(2)35011200,10201202B求1B。B=[3,5,0,1;1,2,0,0;1,0,2,0;1,2,0,2]inv(B)ans=2.0000-4.0000-0.0000-1.0000-1.00002.50000.00000.5000-1.00002.00000.50000.50000-0.500000.50009、在MATLAB中判断下列向量组是否线性相关,并找出向量组1(1132),T234(1113),(5289),(1317)TTT中的一个最大线性无关组。11a1=[1132]'a2=[-11-13]'a3=[5-289]'a4=[-1317]'A=[a1,a2,a3,a4];[Rjb]=rref(A)a1=1132a2=-11-13a3=5-289a4=-1317R=1.0000001.090901.000001.7879001.0000-0.0606120000jb=123A(:,jb)ans=1-1511-23-1823910、在MATLAB中判断下列方程组解的情况,若有多个解,写出通解。(1)123412341234123442020372031260xxxxxxxxxxxxxxxx一:A=[1,-1,4,2;1,-1,-1,2;3,1,7,-2;1,-3,-12,6];rank(A)ans=3rref(A)ans=1000010-200100000二:A=[1,-1,4,2;1,-1,-1,2;3,1,7,-2;1,-3,-12,6];formatratn=4;RA=rank(A)RA=133if(RA==n)fprintf('%方程只有零解')elseb=null(A,'r')endb=0201symskX=k*bX=02*k0k(2)12312312312323424538213496xxxxxxxxxxxxA=[231;1-24;38-2;4-19];b=[4-513-6]';B=[Ab];n=3;RA=rank(A)RA=2RB=rank(B)RB=214rref(B)ans=102-101-1200000000formatratifRA==RB&RA==n%判断有唯一解X=A\belseifRA==RB&RAn%判断有无穷解X=A\b%求特解C=null(A,'r')%求AX=0的基础解系elseX='equitionnosolve'%判断无解endWarning:Rankdeficient,rank=2,tol=8.9702e-015.X=03/2-1/2C=-21111、求矩阵211020413A的逆矩阵1A及特征值和特征向量。A=[-211;020;-413];a1=inv(A)a1=-3/21/21/201/20-21/21[P,R]=eig(A)15P=-985/1393-528/2177379/125700379/419-985/1393-2112/2177379/1257R=-100020002A的三个特征值是:r1=-1,r2=2,r3=2。三个特征值分别对应的特征向量是P1=[101];p2=[104];p3=[131]12、化方阵222254245A为对角阵。A=[22-2;25-4;-2-45];[P,D]=eig(A)P=-0.29810.89440.3333-0.5963-0.44720.6667-0.74540-0.6667D=1.00000001.000000010.0000B=inv(P)*A*PB=1.0000-0.00000.00000.00001.00000.0000-0.0000010.000016程序说明:所求得的特征值矩阵D即为矩阵A对角化后的对角矩阵,D和A相似。13、求一个正交变换,将二次型222123121323553266fxxxxxxxxx化为标准型。A=[5-13;-15-3;3-33];symsy1y2y3y=[y1;y2;y3];[P,D]=eig(A)P=881/2158985/1393-780/1351-881/2158985/1393780/1351-881/10790-780/1351D=*00040009x=P*yx=(6^(1/2)*y1)/6+(2^(1/2)*y2)/2-(3^(1/2)*y3)/3(2^(1/2)*y2)/2-(6^(1/2)*y1)/6+
本文标题:MATLAB实验练习题(计算机)-南邮-MATLAB-数学实验大作业答案
链接地址:https://www.777doc.com/doc-1753778 .html