当前位置:文档之家› 数学软件MATLAB实验作业

数学软件MATLAB实验作业

数学软件与数学实验作业一.《数学软件》练习题(任选12题,其中19-24题至少选2题):3.对下列各式进行因式分解.(1). syms x y>> factor(x^5-x^3)(2). syms x y>> factor(x^4-y^4)(3). syms x>> factor(16-x^4)(4). syms x>> factor(x^3-6*x^2+11*x-6)(5). syms x y>> factor((x+y)^2-10*(x+y)+25)(6). syms x y>> factor(x^2/4+x*y+y^2)(7). syms x y a b>> factor(3*a*x+4*b*y+4*a*y+3*b*x)(8). syms x>> factor(x^4+4*x^3-19*x^2-46*x+120)5.解下列方程或方程组.(1).solve('(y-3)^2-(y+3)^3=9*y*(1-2*y)')(2). solve('3*x^2+5*(2*x+1)')(3). solve('a*b*x^2+(a^4+b^4)*x+a^3*b^3','x')(4). solve('x^2-(2*m+1)*x+m^2+m','x')(5). [x,y]=solve('4*x^2-9*y^2=15','2*x-3*y=15')6.计算极限.(1). syms xf=(exp(x)-exp(-x))/sin(x);limit(f,x,0)(2) syms x>> f=(x/(x-1)-1/log(x));>> limit(f,x,1)(3). syms x>> f=(1-cos(x))/x^2;>> limit(f,x,0)(4). syms x>> f=1+1/x^2;>> limit(f,x,inf)9.计算下列不定积分.(1). int('(2*x-3)^100','x')(2) int('(x+1)*x^(-1\2)','x')(3). int('(x^2)*(a^x)','x')(4). int('(2*x^2-5)/(x^4-5*x^2+6)','x')(5). int('ln(x+(1+x^2)^1/2)','x')(7). F=int(int('arctan(y/x)','x'),'y')(8). F=int(int(int('x*y*z*(1-x-y)','x'),'y'),'z')10.计算下列定积分.(1). F=int('(sin(x))^2*(cos(x))^2','x','1','0')(2). F=int('(exp(x)-1)^1/2','x','ln2','0')(3) F =int('(exp(x)^1/2)/(exp(x)+exp(-x))^1/2','x','1','0')(4). F=int('x^2/(x^2+a^2)^1/2','a','0')(5). F=int(int('x^2+y^3','y','1-x','1'),'x','2','1')(6). F =int(int('x*y^2','y','x','x^2'),'x','1','0')(7). F= int(int('r^2*(sin(&))^2', 'r', '0','a'), '& ','0','2*pi')(8).F=int(int(int('x*y*z','z','x+y','0'),'y','x','0'),'x','1','0') 13.计算行列式.(1)A=[1 2 3 4;2 3 4 1;3 4 1 2;4 1 2 3];>> det(A)(2). syms a b>> A=[1+a 1 1 1;1 1-a 1 1;1 1 1+b 1;1 1 1 1-b];>> det(A)14.计算AB,AC,B2,和CA.A=[1 0 -1;0 2 3]A =1 0 -10 2 3>> B=[2 -1 4;1 0 -2;0 3 1]B =2 -1 41 0 -20 3 1>> C=[0 2;5 -1;3 1]C =0 25 -13 1>> A*B>> A*C>> B^2>> C*A15.求下列矩阵的秩.(1). A=[2 1 -1 1 1;3 -2 1 -3 4;1 4 -3 5 -2]; >> rank(A)(2). B=[1 1 -3 -4 1;3 -1 1 4 3;1 5 -9 -8 1]; >> rank(B)16.求下列矩阵的逆矩阵.(1). A=[-2 1 3;0 -1 1;1 2 0]A =-2 1 30 -1 11 2 0inv(A)(2). B=[3 3 -4 -3;0 6 1 1;5 4 2 1;2 3 3 2]B =3 3 -4 -30 6 1 15 4 2 12 3 3 2>> inv(B)(3) C=[2 5 7 1;6 3 4 0;5 -2 -3 1;1 1 -1 -1]C =2 5 7 16 3 4 05 -2 -3 11 1 -1 -1>> inv(C)17.解下列线性方程组.(1). a=[1 -2 1 1;1 -2 1 -1;1 -2 1 5]; b=[1;-1;5];>> x=a\b(2). A=[1 -2 -1 -2;4 1 2 1 ;2 5 4 -1;1 1 1 1]; B=[2 ;3 ;0 ;1/3];>> X=A\B18.求出下列矩阵的全部特征值和特征向量.(1). >> syms a>> A=[0 a;-a 0];>> [V D]=eig(A)(2).B=[0 0 1;0 1 0;1 0 0];>> [V D]=eig(B)(3). C=[1 1 1 1;1 1 -1 -1;1 -1 1 -1;1 1 -1 1];>> [V D]=eig(C)19.作出下列函数的图像.(1). x=-100:0.1:100;y=1+x+x.^2;>> plot(x,y,'red-')(2). x=-70:0.1:70;y=(x-1).*(x-2).^2;>> plot(x,y,'g.')(3). >> x=-10:0.1:10;y=x+sin(x);plot(x,y,'yel*')(4.) x=-60:0.1:60;>> y=x.^2.*(sin(x)).^2;>> plot(x,y,'b:')21.画处下列参数方程所表示的曲线.(1). t=-6:0.1:6;x=(t+1).^2/4;y=(t-1).^2/4;>> plot(x,y)(2). syms at=-pi:0.1:pi;x=a.*cos(2.*t);y=a.*cos(3.*t);>> plot(x,y)(3).t=pi:pi/100:6*pi;x=t.*log(t);y=log(t)/t;>> plot(x,y)二.《数学实验》练习题(任选2题)3.通过计算机编程求10000以内的所有素数.For[m=2,m<10000,m++,s=0;t={};For[i=1,i<m,i++,If[Mod[m,i]==0,s=s+i;t=Append[t,i]]];If[s==m,Print[m,t]]]p=11;m=2^p-1;n=0;For[i=1,i<Sqrt[m],i++,If[Mod[m,i]==0,n=1;Break[]]];If[n==1,Print["m is not a prime number"],Print["m is a prime number"]]m=2^12 (2^13-1);s=0;t={};For[i=1,i<m,i++,If[Mod[m,i]==0,s=s+i;t=Append[t,i]]];If[s==m,Print[m,t]]练习二(3)gp={{1,2,3,4},{2,1,4,4},{3,3,1,1},{4,4,2,1}};For[n=1,n<100000,n++,gp[[2,2]]=Random[Integer,{1,4}];gp[[2,3]]=Random[Integer,{1,4}];gp[[2,4]]=Random[Integer,{1,4}];gp[[3,2]]=Random[Integer,{1,4}];gp[[3,3]]=Random[Integer,{1,4}];gp[[4,2]]=Random[Integer,{1,4}];gp[[4,3]]=Random[Integer,{1,4}];gp[[4,4]]=Random[Integer,{1,4}];p=0;For[k1=1,k1<5,k1++,For[k2=1,k2<5,k2++,For[k3=1,k3<5,k3++,If[gp[[gp[[k1,k2]],k3]]!=gp[[k1,gp[[k2,k3]]]],p++]]]];q=0;For[s=1,s<5,s++,If[Length[Union[gp[[s]]]]<4 || Length[Union[{gp[[1,s]],gp[[2,s]],gp[[3,s]],gp[[4,s]]}]] <4,q++]];If[p==0 && q==0,Print["true"];Print[gp]]]。

相关主题