




已阅读5页,还剩23页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
MATLAB语言与应用上机实验作业第一部分2、 用MATLAB语句输入矩阵和 , 前面给出的是矩阵,如果给出命令将得出什么结果?MATLAB结果: A=1 2 3 4;4 3 2 1;2 3 4 1;3 2 4 1; B=1+4j 2+3j 3+2j 4+1j;4+1j 3+2j 2+3j 1+4j;2+3j 3+2j 4+1j 1+4j;3+2j 2+3j 4+1j 1+4j; AA = 1 2 3 4 4 3 2 1 2 3 4 1 3 2 4 1 BB = 1.0000 + 4.0000i 2.0000 + 3.0000i 3.0000 + 2.0000i 4.0000 + 1.0000i 4.0000 + 1.0000i 3.0000 + 2.0000i 2.0000 + 3.0000i 1.0000 + 4.0000i 2.0000 + 3.0000i 3.0000 + 2.0000i 4.0000 + 1.0000i 1.0000 + 4.0000i 3.0000 + 2.0000i 2.0000 + 3.0000i 4.0000 + 1.0000i 1.0000 + 4.0000i A(5,6)=5A = 1 2 3 4 0 0 4 3 2 1 0 0 2 3 4 1 0 0 3 2 4 1 0 00 0 0 0 0 53、假设已知矩阵,试给出相应的MATLAB命令,将其全部偶数行提取出来,赋给矩阵,用命令生成矩阵,用上述命令检验一下结果是不是正确。MATLAB结果: A=magic(8); AA = 64 2 3 61 60 6 7 57 9 55 54 12 13 51 50 16 17 47 46 20 21 43 42 24 40 26 27 37 36 30 31 33 32 34 35 29 28 38 39 25 41 23 22 44 45 19 18 48 49 15 14 52 53 11 10 56 8 58 59 5 4 62 63 1 B=A(2:2:end,:)B = 9 55 54 12 13 51 50 16 40 26 27 37 36 30 31 33 41 23 22 44 45 19 18 488 58 59 5 4 62 63 14、用数值方法可以求出,试不采用循环的形式求出和式的数值解。由于数值方法是采用double形式进行计算的,难以保证有效位数字,所以结果不一定精确。试采用运算的方法求该和式的精确值。MATLAB结果: format long; sum(2.0:63)ans = 1.844674407370955e+0195、选择合适的步距绘制出下面的图形。(1),其中; (2),其中。MATLAB结果:(1),其中t=-1:0.05:-0.2,-0.199:0.001:0.2,0.2:0.05:1;y=sin(1./t);Warning: Divide by zero. plot(t,y)(2),其中 x=-pi:0.05:-1.8,-1.7999:0.001:-1.2,-1.2:0.05:1.2,1.201:0.001:1.8,1.81:0.05:pi; y=sin(tan(x)-tan(sin(x); plot(x,y)6、试绘制出二元函数的三维图和三视图。MATLAB结果:三维图:xx=-2:0.1:-1.2,-1.1:0.02:-0.9,-0.8:0.1:0.8,0.9:0.02:1.1,1.2:0.1:2;yy=-1:0.1:-0.2,-0.1:0.02:0.1,0.2:0.1:1; x,y=meshgrid(xx,yy); z=1./(sqrt(1-x).2+y.2)+1./(sqrt(1+x).2+y.2);Warning: Divide by zero.Warning: Divide by zero. surf(x,y,z)三视图: subplot(224),surf(x,y,z); subplot(221),surf(x,y,z),view(0,90); subplot(222),surf(x,y,z),view(90,0); subplot(223),surf(x,y,z),view(0,0)7、试求出如下极限。(1); (2); (3)。MATLAB结果:(1) syms x; f=(3x+9x)(1/x); L=limit(f,x,inf) L = 9(2) syms x y ; f=(x*y)/(x*y)+1)(1/2)-1); L=limit(limit(f,x,0),y,0) L = 2(3) syms x y ;f=(1-cos(x2+y2)/(x2+y2)*exp(x2+y2); L=limit(limit(f,x,0),y,0) L = 08、已知参数方程,试求出和MATLAB结果: syms t;x=log(cos(t);y=cos(t)-t*sin(t);f1=diff(y,t)/diff(x,t) f1 = -(-2*sin(t)-t*cos(t)/sin(t)*cos(t) f2=diff(y,t,2)/diff(x,t,2);subs(f2,t,sym(pi/3) ans = 3/8-1/24*pi*3(1/2)9、假设,试求。MATLAB结果: syms x y t;f=int(exp(-t2),t,0,x*y);F=(x/y)*(diff(f,x,2)-2*(diff(diff(f,x,1),y,1)+diff(f,y,2) F = 2*x2*y2*exp(-x2*y2)-2*exp(-x2*y2)-2*x3*y*exp(-x2*y2)10、试求出下面的极限。 (1);(2)。MATLAB结果:(1) syms n m;limit(symsum(1/(2*m)2-1),m,1,n),n,inf) ans = 1/2(2) syms m n;limit(symsum(n*(1/(n2+m*pi),m,1,n),n,inf)ans = 111、试求出以下的曲线积分。 (1),为曲线, 。 (2),其中为正向上半椭圆。MATLAB结果:(1) syms t;syms a positive;x=a*(cos(t)+t*sin(t);y=a*(sin(t)-t*cos(t); I=int(x2+y2)*sqrt(diff(x,t)2+diff(y,t)2),t,0,2*pi) I = 2*a3*pi2+4*a3*pi4(2) syms t x y;syms a c b positive;x=c*cos(t)/a;y=c*sin(t)/b;F=y*x3+exp(y),x*y3+x*exp(y)-2*y;ds=diff(x,t);diff(y,t); I=int(F*ds,t,pi,0) I = 2/15*c*(-2*c4+15*b4)/a/b412、试求出Vandermonde矩阵的行列式,并以最简的形式显示结果。MATLAB结果: syms a b c d e;A=a4,a3,a2,a,1;b4,b3,b2,b,1;c4,c3,c2,c,1;d4,d3,d2,d,1;e4,e3,e2,e,1;simple(det(A)ans = (a-c)*(b-c)*(b-a)*(d-c)*(d-a)*(d-b)*(-c+e)*(e-a)*(e-b)*(e-d)13、试对矩阵进行Jordan变换,并得出变换矩阵。MATLAB结果: A=-2 0.5 -0.5 0.5;0 -1.5 0.5 -0.5;2 0.5 -4.5 0.5;2 1 -2 -2;V,J=jordan(A)V = 0 0.50000000000000 0.50000000000000 -0.25000000000000 0 0 0.50000000000000 1.00000000000000 0.25000000000000 0.50000000000000 0.50000000000000 -0.25000000000000 0.25000000000000 0.50000000000000 1.00000000000000 -0.25000000000000J = -4 0 0 0 0 -2 1 0 0 0 -2 1 0 0 0 -214、试用数值方法和解析方法求取下面的Sylvester方程,并验证得出的结果。MATLAB结果:数值解: A=3 -6 -4 0 5;1 4 2 -2 4;-6 3 -6 7 3;-13 10 0 -11 0;0 4 0 3 4;B=3 -2 1;-2 -9 2;-2 -1 9;C=-2 1 -1;4 1 2;5 -6 1;6 -4 -4;-6 6 -3;X=lyap(A,B,C),norm(A*X+X*B+C)X = 4.05689641914739 14.51278207738230 -1.56531072870960 -0.03555750760035 -25.07427777300226 2.74080695262868 -9.48864527098864 -25.93232765032886 4.41773341615773 -2.69692229648079 -21.64500921402601 2.88508413748940 -7.72287238941912 -31.90996053309000 3.76340871020125ans = 2.791709573159607e-01315、假设已知矩阵如下,试求出,。MATLAB结果: syms t;A=-4.5,0,0.5,-1.5;-0.5,-4,0.5,-0.5;1.5,1,-2.5,1.5;0,-1,-1,-3;B=simple(expm(A*t)C=simple(sin(A*t)D=simple(expm(A*t)*sin(A2*expm(A*t)*t) B = 1/2/exp(t)3-1/2*t/exp(t)3+1/2/exp(t)5+1/2*t2/exp(t)3, 1/2/exp(t)5-1/2/exp(t)3+t/exp(t)3, 1/2*t/exp(t)3+1/2*t2/exp(t)3, 1/2/exp(t)5-1/2/exp(t)3-1/2*t/exp(t)3+1/2*t2/exp(t)3 1/2*t/exp(t)3+1/2/exp(t)5-1/2/exp(t)3, 1/2/exp(t)3+1/2/exp(t)5, 1/2*t/exp(t)3, 1/2*t/exp(t)3+1/2/exp(t)5-1/2/exp(t)3 1/2*t/exp(t)3-1/2/exp(t)5+1/2/exp(t)3, -1/2/exp(t)5+1/2/exp(t)3, 1/exp(t)3+1/2*t/exp(t)3, 1/2*t/exp(t)3-1/2/exp(t)5+1/2/exp(t)3 -1/2*t2/exp(t)3, -t/exp(t)3, -1/2*t2/exp(t)3-t/exp(t)3, 1/exp(t)3-1/2*t2/exp(t)3 C = -sin(9/2*t), 0, sin(1/2*t), -sin(3/2*t) -sin(1/2*t), -sin(4*t), sin(1/2*t), -sin(1/2*t) sin(3/2*t), sin(t), -sin(5/2*t), sin(3/2*t) 0, -sin(t), -sin(t), -sin(3*t) D = (1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t2*exp(-3*t)*sin(t*(17/2*exp(-3*t)-21/2*t*exp(-3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25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*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+5*exp(-3*t), (1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)+(1/2*exp(-3*t)+1/2*exp(-5*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+1/2*t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t) (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(17/2*exp(-3*t)-21/2*t*exp(-3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t), (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-21/2*exp(-3*t)+9*t*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)+9/2*exp(-3*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(-25/2*exp(-5*t)+9/2*exp(-3*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(6*exp(-3*t)-9*t*exp(-3*t), (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-3/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-2*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)-3*exp(-3*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)+6*exp(-3*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+5*exp(-3*t), (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t) -1/2*t2*exp(-3*t)*sin(t*(17/2*exp(-3*t)-21/2*t*exp(-3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(-exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t), -1/2*t2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-21/2*exp(-3*t)+9*t*exp(-3*t)-t*exp(-3*t)*sin(t*(25/2*exp(-5*t)+9/2*exp(-3*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(-25/2*exp(-5*t)+9/2*exp(-3*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(6*exp(-3*t)-9*t*exp(-3*t), -1/2*t2*exp(-3*t)*sin(t*(-3/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-2*exp(-3*t)-t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)-3*exp(-3*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)+6*exp(-3*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+5*exp(-3*t), -1/2*t2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t) 第二部分1、对下列的函数进行Laplace变换。(1);(2);(3)。MATLAB结果:(1)syms t alpha;f=sin(alpha*t)/t;F=laplace(f) F = atan(alpha/s)(2)syms t alpha;f=t5*sin(alpha*t);F=laplace(f) F = 120/(s2+alpha2)3*sin(6*atan(alpha/s)(3)syms t alpha;f=t8*cos(alpha*t);F=laplace(f) F = 40320/(s2+alpha2)(9/2)*cos(9*atan(alpha/s)2、对下面的式进行Laplace反变换。(1);(2);(3)。MATLAB结果: (1) syms s a b;f=1/(sqrt(s2)*(s2-a2)*(s+b);F=ilaplace(f) F =-1/2/(a-b)/a2*exp(-a*t)+1/2/(a+b)/a2*exp(a*t)-1/a2/b+1/b/(a2-b2)*exp(-b*t)(2) syms s a b;f=sqrt(s-a)-sqrt(s-b);F=ilaplace(f) F =1/2/t/(t*pi)(1/2)*(exp(b*t)-exp(a*t)(3) syms s a b;f=log(s-a)/(s-b);F=ilaplace(f) F =(exp(b*t)-exp(a*t)/t3、试求出下面函数的Fourier变换,对得出的结果再进行Fourier反变换,观察是否能得出原来函数。(1);(2)。MATLAB结果: (1) syms x;f=x2*(3*pi-2*abs(x);F=fourier(f)f1=ifourier(F) F = -6*(4+pi2*dirac(2,w)*w4)/w4f1 =x2*(-4*x*heaviside(x)+3*pi+2*x)(2) syms t;f=t2*(t-2*pi)2;F=fourier(f) f1=ifourier(F) F =2*pi*(-4*pi2*dirac(2,w)+4*i*pi*dirac(3,w)+dirac(4,w) f1 =x2*(2*pi-x)24、 请将下述时域序列函数进行Z变换,并对结果进行反变换检验。(1);(2);(3)。MATLAB结果: (1) ;syms a T k z;f=cos(k*a*T);F=ztrans(f,k,z)f1=iztrans(F,z,k) F = (z-cos(a*T)*z/(z2-2*z*cos(a*T)+1) f1 = cos(k*a*T)(2)syms a T k z;f=(k*T)2*exp(-a*k*T);F=ztrans(f,k,z)f1=iztrans(F,z,k) F = T2*z*exp(-a*T)*(z+exp(-a*T)/(z-exp(-a*T)3 f1 = T2*(1/exp(a*T)k*k2(3)syms a T k z;f=(1/a)*(a*k*T-1+exp(-a*k*T);F=ztrans(f,k,z)f1=iztrans(F,z,k) F = 1/a*(a*T*z/(z-1)2-z/(z-1)+z/exp(-a*T)/(z/exp(-a*T)-1) f1 = (k*a*T+(1/exp(a*T)k-1)/a5、 用数值求解函数求解下述一元和二元方程的根,并对得出的结果进行检验。(1);(2)(1)MATLAB结果:syms x;f=exp(-(x+1)2+pi/2)*sin(5*x+2);t=solve(f)subs(f,x,-2/5) t = -2/5 ans = 0(2) syms x y;f=(x2+y2+x*y)*exp(-x2-y2-x*y);x1=solve(x2+y2+x*y)*exp(-x2-y2-x*y),x)simple(subs(f,x,x1) x1 = (-1/2+1/2*i*3(1/2)*y (-1/2-1/2*i*3(1/2)*yans = 0 06、 试求出使得取得极小值的值。MATLAB结果: syms c x;f=(exp(x)-c*x)2;F=int(f,x,0,1);f1=diff(F,c);solve(f1) ans = 37、 试求解下面的非线性规划问题。 MATLAB结果:可以用下面的语句描述目标函数:function y=exc6fun6(x)y=exp(x(1)*(4*x(1)2+2*x(2)2+4*x(1)*x(2)+2*x(2)+1);这时调用非线性最优化问题求解函数可以得出如下结果: A=; B=; Aeq=; Beq=; xm=-10; -10; xM=10; 10;x0=(xm+xM)/2;ff=optimset;ff.TolX=1e-10;ff.TolFun=1e-20;x=fmincon(exc6fun6,x0,A,B,Aeq,Beq,xm,xM,exc6fun6a,ff)Maximum number of function evaluations exceeded;increase OPTIONS.MaxFunEvalsx =0.419473260539100.41947326053910可以看出该结果并非原问题的解,故继续求解如下: i=1; x=x0;while (1)x,a,b=fmincon(exc6fun6,x,A,B,Aeq,Beq,xm,xM,exc6fun6a,ff);if b0, break; endi=i+1;endx,ix =1.18249727581645-1.73976692398900i =58、 求解下面的整数线性规划问题。 MATLAB结果: f=-592 381 273 55 48 37 23;A=3534 2356 1767 589 528 451 304; B=119567;intlist=1;1;1;1;1;1;1;ctype=-1;xm=zeros(7,1); xM=inf*ones(7,1);res,b=ipslv_mex(f,A,B,intlist,xM,xm,ctype)res =32210000b =09、 试求出微分方程的解析解通解,并求出满足边界条件的解析解。MATLAB结果: syms x y;y1=dsolve(D2y-(2-1/x)*Dy+(1-1/x)*y=x2*exp(-5*x),x) y1 = exp(x)*C2+exp(x)*log(x)*C1+1/1296*(6*exp(6*x)*Ei(1,6*x)+11+30*x+36*x2)*exp(-5*x) y=dsolve(D2y-(2-1/x)*Dy+(1-1/x)*y=x2*exp(-5*x),y(1)=sym(pi),y(sym(pi)=1,x) y =-1/1296*exp(x)*(6*exp(1)*Ei(1,6)+77*exp(-5)-1296*sym(pi)/exp(1)-1/1296*exp(x)*log(x)*(-6*Ei(1,6)*exp(6*sym(pi)+6)-77*exp(6*sym(pi)+1296*sym(pi)*exp(6*sym(pi)+5)-3*i*pi*csgn(s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/T 24810.3-2025起重机限制器和指示器第3部分:塔式起重机
- GB/T 46240.1-2025IPv6网络设备安全技术要求和测试方法第1部分:路由器
- 农业生产主体安全培训课件
- 养护安全培训例会课件
- 养护安全作业培训点评课件
- 养兔子的课件
- 化工企业全员安全培训课件
- 微信线下营销方案(3篇)
- 内部安全培训表格模板课件
- 内部安全员培训课件
- 个体诊所管理暂行办法
- 潍坊市2026届高三开学调研监测考试化学试题及答案
- 采购成本控制培训
- 商业地产策划流程
- GB 46031-2025可燃粉尘工艺系统防爆技术规范
- 破圈与共生:2025中国社交媒体全球化发展报告
- 2025年社保理赔考试题目及答案
- 产教融合校企合作课件
- 质量攻关项目汇报
- 电力企业综合应急预案编制导则
- 收单外包管理办法
评论
0/150
提交评论