一、填空题(本题满分 30 分,每空 3 分) 1
设有程序A=[2,0,1,0;1,0,1,5;0, 6 ,2, 3];B=[1,2,-1;1,3,1];C=A(1:3,[1,2]);D=size(C)- length(B(2,:));F= C
*B’将下列命令的运行结果填在横线上 0*、0D = [0 -1] ; F= [2 0;2 0;0 6]
A=[2,3,2,1;1,2,2,1; 1,2,3,-2];A1=sum(A>A(2,1));A(2,:)=[],A2=A
^2-4 A1= ; A2= ; 3
P=[1,2,5,4;2,2,1,3];max(P,[ ],1)= [2 2 5 4] ;mean(P,2)= [3 2]
二、(本题满分 10 分)试编写计算程序画出曲线与曲面图形5
a=[ ];for i=1:3;for j=1:3;a(i,j)=(i-j)*abs(i-j);endendb=a(8)*a运行结果b=
function f=price(a)switch fix(a/100); case {0,1,2} rate=0; otherwise rate=0
05endf=a*(1-rate)运行结果price (300)= 285
x=0; n=1;while n