Matlab基础与应用教程答案(人民邮出版社).docVIP

  • 2
  • 0
  • 约1.95万字
  • 约 18页
  • 2018-11-17 发布于浙江
  • 举报

Matlab基础与应用教程答案(人民邮出版社).doc

Matlab基础与应用教程答案(人民邮出版社)

第1章 一、思考题 4. (1) B=A(2:5,1:2:5) (2)A(7)=[] (3) A=A+30 (4)size(A) (5) t(find(t==0))=eps (6)t=reshape(x,3,4) (7)abs(matlab) (8)char(93) 5. A=[97,67,34,10;-78,75,65,5;32,5,-23,-59;0,-12,54,7] (1) B=A(1:3,:) C=A(:,1:2) D=A(2:4,3:4) E=B*C (2)A(find(A=50 A=100)) 二、实验题 1.x=-74/180*pi;y=-27/180*pi; sin(x*x+y*y)/sqrt(tan(abs(x+y)))+pi 2.a=-3.0:0.1:3.0; exp(-0.3*a).*sin(a+0.3) 3.x=[2,4;-0.45,5]; log(x+sqrt(1+x.*x))/2 4. A=[3,54,2;34,-45,7;87,90,15];B=[1,-2,67;2,8,74;9,3,0]; (1)A*B ans = 129 432 4197 7 -407 -1052 402 591 12489 A.*B ans = 3 -108 134 68 -360 518 783 270 0 (2) A^3 ans = -28917 240246 -4368 137883 -259101 27669 171333 252504 38673 A.^3 ans = 27 157464 8 39304 -91125 343 658503 729000 3375 (3)A/B ans = -5.8845 5.3549 -0.2028 6.3554 -5.6596 4.3293 -6.6325 6.2078 9.0241 B/A ans = 30.2855 19.2643 -8.5614 33.4394 21.1547 -9.3974 -0.7443 -0.3938 0.2830 (4)[A,B] ans = 3 54 2 1 -2 67 34 -45 7 2 8 74 87 90 15 9 3 0 [A([1,3],:);B^2] ans = 3 54 2 87 90 15 600 183 -81 684 282 726 15 6 825 5.a=1+2i;b=3+4i; c=exp(pi*i/6) c = 0.8660 + 0.5000i c+a*b/(a+b) ans = 1.6353 + 1.8462i 第2章 一、思考题 3.s=0; for n=0:63 s=s+2^n; end disp(s) n=0:63; s=sum(2.^n) 二、实验题 1. x=input(输入一个四位整数:); y=[fix(x/1000),mod(fix(x/100),10),mod(fix(x/10),10),mod(x,10)] z=mod((y+7),10) x=z(3)*1000+z(4)*100+z(1)*10+z(2) 2. gh=input(输入工号); h=input(输入工时); dj=84; if h120 gz=dj*120+1.15*dj*(h-120); elseif h60 gz=dj*h-700; else gz=dj*h; end format bank; display([gh,gz]) 3. 循环结构 n=input(input n:); s=0; for k=1:n s=s+1/k^2; end display(sqrt(s*6)) 向量运算 n=input(input n:); k=1:n; display(sqrt(sum(1./k.^2)*6)) 4. y=0;k=0; while

文档评论(0)

1亿VIP精品文档

相关文档