RosettaCodeData/Task/Matrix-multiplication/Octave/matrix-multiplication.octave

14 lines
165 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
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