第二章 1 求下列表达式的值。 (1) w=sqrt(2)*(1+0.34245*10^(-6)) (2) a=3.5; b=5; c=-9.8; x=(2*pi*a+(b+c)/(pi+a*b*c)-exp(2))/tan(b+c)+a (3) a=3.32; b=-7.9; y=2*pi*a^(2)*[(1-pi/4)*b-(0.8333-pi/4)*a] (4) t=[2,1-3*i;5,-0.65]; z=1/2*exp(2*t)*log(t+sqrt(1+t^(2))) 2 求下列表达式 A=[-1,5,-4;0,7,8;3,61,7]; B=[8,3,-1;2,5,3;-3,2,0]; (1) A+6*B A^2-B+eye (2) A*B A.*B B.*A (3) A/B B\A (4) [A,B] [A([1,3],:);B^2] 3 根据已知,完成下列操作 (1) A=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14]; K=find(A>10&A<25); A(K) (2) A=[23,10,-0.778,0;41,-45,65,5;32,5,0,32;6,-9.54,54,3.14]; B=A(1:3,:) C=A(:,1:2) D=A(2:4,3:4) E=B*C (3) E=90&&score<=100 disp('A'); elseif score>=80&&score<=89 disp('B'); elseif score>=70&&score<=79 disp('C'); elseif score>=60&&score<=69; disp('D'); elseif score<60&&score>=0; disp('E'); else disp('出错'); end 用 switch 语句 score=input('请输入成绩:'); switch fix(score/10) case {9,10} disp('A'); case {8} disp('B'); case {7} disp('C'); case {6} disp('D'); case {0,1,2,3,4,5} disp('E'); otherwise disp('出错'); end 第 四 章 1 题 1) X=0:10; Y=x-x.^3/6; Plot(x,y) 2) t=0:0.01:2*pi; x=8.*cos(t); y=4*sqrt(2).*sin(t); plot(x,y) 2 题 M 文件: t=-pi:pi/10:pi; y=1./(1+exp(-t)); subplot(2,2,1);bar(t,y,'b'); title('bar(t,y,''b'')');axis([-5,5,-3,3]); subplot(2,2,2);stairs(t,y,'k'); title('stairs (t,y,''k'')');axis([-5,5,-3,3]); subplot(2,2,3);stem(t,y,'m'); title('stem (t,y,''m'')');axis([-5,5,-3,3]); subplot(2,2,4);loglog(t,y,'g'); title('loglog(t,y,''g'')');axis([-5,5,-3,3]); 3 题 1) t=0:pi/100:2*pi; y=5*cos(t)+4; polar(t,y,'-*') 2) t=-pi/3:pi/100:pi/3; r=5*sin(t).^2./cos(t); polar(t,r,'-*') 4 题 1) t=0:pi/100:2*pi; x=exp(-t/20).*cos(t); y=...