1、第二章3.设矩阵 A 为A=24 23 9 21 6;65 74 24 11 21;34 5 98 75 21;8 42 42 53 121;43 21 45 64 21;(1) B=A(2:5,1:2:5)B =65 24 2134 98 218 42 12143 45 21(2)A(7)=A =24 65 34 8 43 23 5 42 21 9 24 98 42 45 21 11 75 53 64 6 21 21 121 21(3)A+30(4)size(A);ndims(A)(5)题目有误(6)reshape(x,3,4)(7)abs(x)(8)char(x)4. L1 =0 0 0
2、0 1 0 0 0 0L2 =1 1 1 1 1 0 0 0 0L3 =0 0 0 1 1 1 0 0 0L4 =4 5 65.(1)B=A(1:3,:)C=A(:,1:2)D=A(2:4,3:4)E=B*CB =23.0000 10.0000 -0.7780 041.0000 -45.0000 65.0000 5.000032.0000 5.0000 0 32.0000C =23.0000 10.000041.0000 -45.000032.0000 5.00006.0000 -9.5400D =65.0000 5.00000 32.000054.0000 3.1400E =1.0e+003
3、 *0.9141 -0.22391.2080 2.71231.1330 -0.2103(2)E=10endb=fix(a/1000);c=rem(fix(a/100),10);d=rem(fix(a/10),10);e=rem(a,10);b=b+7;c=c+7;d=d+7;e=e+7;b=rem(b,10);c=rem(c,10);d=rem(c,10);e=rem(e,10);g=b;b=d;d=g;g=c;c=e;e=g;a=1000*d+100*e+10*b+c;disp(加密后:,num2str(a)2.a=input(请输入a: );b=input(请输入b: );c=input(请输入c: );x=0.5:1:5.5;x1=(x=0.5elseif b