当前位置:文档之家› MATLAB实验练习题(计算机) 南邮 MATLAB 数学实验大作业答案

MATLAB实验练习题(计算机) 南邮 MATLAB 数学实验大作业答案

“MATLAB”练习题要求:抄题、写出操作命令、运行结果,并根据要求,贴上运行图。

1、求230x e x -=的所有根。

(先画图后求解)(要求贴图)>> 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) 5510x x ++=a=solve('x^5+5*x+1',0);a=vpa(a,6)1.10447+1.05983*i -1.00450+1.06095*i-.199936 -1.00450-1.06095*i 1.10447-1.05983*i2)1sin02x x-=至少三个根>> fzero('x*sin(x)-1/2', 3) ans =2.9726>> fzero('x*sin(x)-1/2',-3) ans =-2.9726>> fzero('x*sin(x)-1/2',0) ans =-0.74083)2sin cos 0x x x -= 所有根>> fzero('sin(x)*cos(x)-x^2',0)ans =>> fzero('sin(x)*cos(x)-x^2',0.6)ans =0.70223、求解下列各题:1)30sin lim x x xx ->->> sym x;>> limit((x-sin(x))/x^3)ans =1/62) (10)cos ,x y e x y =求>> sym x;>> diff(exp(x)*cos(x),10)ans =(-32)*exp(x)*sin(x)3)21/20(17x e dx ⎰精确到位有效数字)>> sym x;>> vpa((int(exp(x^2),x,0,1/2)),17)ans =0.544987104183622224)42254x dx x+⎰>> sym x;>> int(x^4/(25+x^2),x)ans =125*atan(x/5) - 25*x + x^3/35)求由参数方程arctan x y t⎧⎪=⎨=⎪⎩所确定的函数的一阶导数dy dx 与二阶导数22d y dx 。

>> sym t;>> x=log(sqrt(1+t^2));y=atan(t);>> diff(y,t)/diff(x,t)ans =1/t6)设函数y =f (x )由方程xy +e y = e 所确定,求y ′(x )。

>> syms x y;f=x*y+exp(y)-exp(1);>> -diff(f,x)/diff(f,y)ans =-y/(x + exp(y))7)sin2xe xdx+∞-⎰>> syms x;>> y=exp(-x)*sin(2*x);>> int(y,0,inf)ans =2/58)08x=展开(最高次幂为)>> syms xf=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)xy e y=求>> syms x y;>> y=exp(sin(1/x));>> dy=subs(diff(y,3),x,2)dy =-0.582610)求变上限函数xx⎰对变量x的导数。

>> syms a t;>> diff(int(sqrt(a+t),t,x,x^2))Warning: Explicit integral could not be found.ans =2*x*(x^2 + a)^(1/2) - (a + x)^(1/2)4、求点(1,1,4)到直线L : 31102x y z --==- 的距离>> 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()2(),2x f x e μσπσ--=分别在下列条件下画出()f x 的图形:(要求贴图)(1)1,011σμ=时=,-,,在同一坐标系里作图>> syms x;>> fplot('(1/sqrt(2*pi))*exp(-((x)^2)/2)',[-3,3],'r')>> hold on>> fplot('(1/sqrt(2*pi))*exp(-((x-1)^2)/2)',[-3,3],'y')>> hold on>> fplot('(1/sqrt(2*pi))*exp(-((x+1)^2)/2)',[-3,3],'g')>> hold off(2)0,124μσ=时=,,,在同一坐标系里作图。

>> syms x;fplot('(1/sqrt(2*pi))*exp(-((x)^2)/2)',[-3,3],'r')hold onfplot('(1/(sqrt(2*pi)*2))*exp(-((x)^2)/(2*2^2))',[-3,3],'y') hold onfplot('(1/(sqrt(2*pi)*4))*exp(-((x)^2)/(2*4^2))',[-3,3],'g')hold off6、画下列函数的图形:(要求贴图)(1)sin020 cos024x u tty u tutz⎧⎪=≤≤⎪=⎨≤≤⎪⎪=⎩>> ezmesh('u*sin(t)','u*cos(t)','t/4',[0,20,0,2]) (2) sin()03,03z xy x y=≤≤≤≤>> x=0:0.1:3;y=x;[X Y]=meshgrid(x,y);Z=sin(X*Y);>> mesh(X,Y,Z)(3)sin (3cos )02cos (3cos )02sin x t u t y t u u z u ππ=+⎧≤≤⎪=+⎨≤≤⎪=⎩ezmesh('sin(t)*(3+cos(u))','cos(t)*(3+cos(u))','sin(u)',[0,2*pi,0,2*pi])7、 已知422134305,203153211A B -⎛⎫⎛⎫ ⎪ ⎪=-=-- ⎪ ⎪ ⎪ ⎪-⎝⎭⎝⎭,在MA TLAB 命令窗口中建立A 、B 矩阵并对其进行以下操作:(1) 计算矩阵A 的行列式的值det()A>> A=[4,-2,2;-3,0,5;1,5,3];>> det(A)ans =-158(2) 分别计算下列各式:1122,*,.*,,,,T A B A B A B AB A B A A --->> A=[4,-2,2;-3,0,5;1,5,3];B=[1,3,4;-2,0,-3;2,-1,1]; >> 2*A-Bans =7 -7 0-4 0 130 11 5>> A*Bans =12 10 247 -14 -7-3 0 -8>> A.*Bans =4 -6 86 0 -152 -5 3>> A*inv(B)ans =-0.0000 -0.0000 2.0000-2.7143 -8.0000 -8.14292.42863.0000 2.2857>> inv(A)*Bans =0.4873 0.4114 1.00000.3671 -0.4304 0.0000-0.1076 0.2468 0.0000>> A*Aans =24 2 4-7 31 9-8 13 36>> A'ans =4 -3 1-2 0 52 5 3>>8、在MA TLAB中分别利用矩阵的初等变换及函数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.0000 2.5000 0.0000 0.5000-1.0000 2.0000 0.5000 0.50000 -0.5000 0 0.50009、在MA TLAB中判断下列向量组是否线性相关,并找出向量组1(1132),Tα=234(1113),(5289),(1317)T T T ααα=--=-=-中的一个最大线性无关组。

>> a1=[1 1 3 2]'a2=[-1 1 -1 3]'a3=[5 -2 8 9]'a4=[-1 3 1 7]'A= [a1, a2 ,a3 ,a4] ;[R jb]=rref(A)a1 =1132a2 =-11-13a3 =5-289a4 =-1317R =1.00000 01.09090 1.0000 0 1.78790 0 1.0000 -0.06060 0 0 0jb =1 2 3>> A(:,jb)ans =1 -1 51 1 -23 -1 82 3 910、在MA TLAB中判断下列方程组解的情况,若有多个解,写出通解。

相关主题