计算均值: >> C=[]; >> for i=1:3 for j=1:4 C(i,j)=mean(B(i,[1:5]+(j-1)*5)); end, end >> C=[C; mean(C)]; C=[C mean(C')'] C = 19.6000 20.0000 21.0000 18.8000 19.8500 24.0000 26.0000 23.2000 21.0000 23.5500 15.0000 16.8000 20.4000 18.4000 17.6500 19.5333 20.9333 21.5333 19.4000 20.3500