B = [1/2 1/4 1/4;1/4 1/4 1/2;0 1/2 1/2]; 
A = zeros(8,8) 
for i=0:8 
  for j=0:8 
     x_1 = floor(i / 3); 
     y_1 = mod(i,3); 
      x_2 = floor(j / 3); 
      y_2 = mod(j,3); 
      A(i + 1,j + 1) = B(x_1+ 1,x_2 + 1)*B(y_1 + 1,y_2 + 1);
    end 
end 
A
