A = zeros(5); # create 5x5 matrix filled with zeros D = A.+B' ; # add element-wise A with transpose of B for j = 1:10 print j;