clear all
n=16;
P1=ones(n);
P2=ones(n);
for p=1:4:13
A(p,:) = [P1(p,p).*P2(p,1:4) P1(p,p+1).*P2(p,1:4) P1(p,p+2).*P2(p,1:4) P1(p,p+3).*P2(p,1:4)];
A(p+1,:) = [P1(p+1,p).*P2(p+1,5:8) P1(p+1,p+1).*P2(p+1,5:8) P1(p+1,p+2).*P2(2,5:8) P1(p+1,p+3).*P2(p+1,5:8)];
A(p+2,:) = [P1(p+2,p).*P2(p+2,9:12) P1(p+2,p+1).*P2(p+2,9:12) P1(p+2,p+2).*P2(3,9:12) P1(p+2,p+3).*P2(p+2,9:12)];
A(p+3,:) = [P1(p+3,p).*P2(p+3,13:16) P1(p+3,p+1).*P2(p+3,13:16) P1(p+3,p+2).*P2(4,13:16) P1(p+3,p+3).*P2(p+3,13:16)];
A
end
Best Answer