A = zeros(5,5); for i=1:5 for j=1:i A(i,j) = i + j; end end b = zeros(5,1); for i = 1:5 b(i) = i+2; end A b