a = zeros(4); % prepare the matrix % 1 1 1 1 % 2 4 8 16 % 3 9 27 81 % 4 16 64 256 for i = 1:4 for j = 1:4 a(i, j) = i^j; endfor endfor b = inverse(a); a * b