当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

厦门大学数学科学学院:《高等代数》课程教学资源(应用与实验)Key to MATLAB Ex 1 - Matrices & Arrays

资源类别:文库,文档格式:PDF,文档页数:2,文件大小:118.08KB,团购合买
点击下载完整版文档(PDF)

Key to MATLAB Exercise 1 School of Mathematical Sciences Xiamen University httplgdipke.xmuedu Key to MatLAB Exersise 1-Matrices arrays 1.>>x0=10,0=15;t5;a=9.81;x=x0+v0*+1/2*a*t2 >>X=3;v=4; 1)>>log(x^2+v^2) 2)>(X-3)^(1/2)(x-2*v)^2 4)>>abs(sin(2 x))exp(v) 5)>sqr(x-5) 6)>>x/(v-4) Warning: Divide by zero. ans=Inf arnI ide by zero. ans=-lnf 9)>>(x-3 (v-4) Warning: Divide by zero. ans= NaN 3. ans =2 ans=0.5000 4.1)>d=[23:-3:2 > numen(d) >>d=[23,20,17,14,11,8,5,2] l(d) 2)>>a=234 6912] >>a=[1:4;22:8,3:3:12] 5.1)>>sze(a) 2)>a(2,3) >>b=a(:1,3]) 3)>>c=a(1,32]-) 7)omited 8)>>a35=a;a35(:5)=[l;1;1 >>aa35=a,[10;20;30J 4=a;a44(4)=[l111 Key to ExI-1

Key to MATLAB Exercise 1  School of Mathematical Sciences Xiamen University  http://gdjpkc.xmu.edu. Key to Ex1­1  Key to MATLAB Exersise 1 ­ Matrices & Arrays 1.  >> x0=10; v0=15; t=5; a=­9.81; x=x0+v0*t+1/2*a*t^2  2.  >> x=3;v=4;  1) >> log(x^2+v^2) 2) >> (x­3)^(1/2)/(x­2*v)^2  3) >> 4/3*pi*v^2  4) >> abs(sin(2*x))*exp(v) 5) >> sqrt(x­5) or >> (x­5)^(1/2) 6) >> x/(v­4) Warning: Divide by zero.  ans =Inf 7) >> ­x/(v­4) Warning: Divide by zero.  ans =­Inf 8) >> eps  9) >> (x­3)/(v­4) Warning: Divide by zero.  ans = NaN  3.  ans = 2  ans = 0.5000  4.  1) >> d=[23:­3:2]  >> numel(d) or >> d=[23,20,17,14,11,8,5,2] >> numel(d) 2) >> a=[1 2 3 4  2 4 6 8  3 6 9 12];  or >> a = [1:4; 2:2:8; 3:3:12];  or >> a1 =[1:4]; a = [a1; 2*a1; 3*a1];  5.  1) >> size(a) 2) >> a(2,3) >> b=a(:,[1,3]) 3) >> c=a([1,3,2],:)  4) >> x=a(:,end) 5) >> a(1,1)=0  6) omited  7) omited  8) >> a35=a; a35(:,5)=[1;1;1] or >> aa35=[a, [10; 20; 30]] >> a44=a; a44(4,:)=[1 1 1 1] or >> a44=(a; 1 1 1 1)

Key to MATLAB Exercise 1 School of Mathematical Sciences Xiamen Univer httplgdipke.xmuedu 9)-14)omited 6.>>x=AB -0.5000 -0.5000 A/B ?? Error using=> mrdivide matrix dimensions must agree A/B is equivalent to the expression AB, but here B is a vector, there is no invert of B 8.1)>>X=0nes(6,1);A*x 0 0 0 0 0 From A*x, we get the sum of every row of A, so we know that the determinant of a equal to 0. that is a must be singular 9.>>A= magIc(8),sum(A(:,1:7) ans=260260260260260260260 10.>>a=[121;A=aa*2a*3];C=-1-1-l},D=-2-24 1)>>A°C >>A*D The results show that though A#0, AC=AD, but C is not equal to D. Therefore the proposition Is not true 2)>>A-round(10"rand( 3)); B-round(10*rand(3)) >>inv(A+B > inv(A)+inv(B) The proposition is not true 3)>(A+By2 >>A^2+2*A*B+B^2 The proposition is not true 4)>>A-round(10*rand(3)); B=A+A >>B=B We may try it more times. All results show the proposition is true Key to Ex1-2

Key to MATLAB Exercise 1  School of Mathematical Sciences Xiamen University  http://gdjpkc.xmu.edu. Key to Ex1­2  9)­14) omited  6.  >> x=A\B ans x=  ­0.5000  1.0000  ­0.5000  7.  >> A/B ??? Error using ==> mrdivide matrix dimensions must agree.  A/B is equivalent to the expression  1 AB - , but here B is a vector, there is no invert of B.  8.  1) >> x=ones(6,1); A*x  ans = 0  0  0  0  0  0  From A*x, we get the sum of every row of A, so we know that the determinant of A equal to  0, that is A must be singular.  2) omited  9.  >> A = magic (8); sum(A(:,1:7)) ans =260  260  260  260  260  260  260  10.  >> a=[1 2 1]; A=[a;a*2;a*3]; C=[­1 ­1­1]'; D=[­2 ­2 4]';  1) >> A*C >> A*D  The results  show that  though  A≠0,  AC=AD,  but  C is not  equal  to D.  Therefore the proposition is not true.  2) >> A=round(10*rand(3)); B=round(10*rand(3));  >> inv(A+B)  >> inv(A)+inv(B) The proposition is not true.  3) >> (A+B)^2  >> A^2+2*A*B+B^2  The proposition is not true.  4) >> A=round(10*rand(3)); B=A+A’;  >> B == B’ ans =  1  1  1  1  1  1  1  1  1  We may try it more times. All results show the proposition is true.  11.  omited

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
已到末页,全文结束
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有