Anonymous user
Matrix transposition: Difference between revisions
no edit summary
No edit summary |
|||
Line 279:
import java.util.Arrays;
public class Transpose{
}
}
}
}
Line 322:
1.00000 8.00000 27.00000 64.00000 125.00000
1.00000 16.00000 81.00000 256.00000 625.00000
=={{header|Pop11}}==
<pre>
define transpose(m) -> res;
lvars bl = boundslist(m);
if length(bl) /= 4 then
throw([need_2d_array ^a])
endif;
lvars i, i0 = bl(1), i1 = bl(2);
lvars j, j0 = bl(3), j1 = bl(4);
newarray([^j0 ^j1 ^i0 ^i1], 0) -> res;
for i from i0 to i1 do
for j from j0 to j1 do
m(i, j) -> res(j, i);
endfor;
endfor;
enddefine;
</pre>
=={{header|Python}}==
Line 344 ⟶ 363:
=={{header|TI-83 BASIC}}==
Assuming the original matrix is in <tt>[A]</tt>, place its transpose in <tt>[B]</tt>:
[A]<sup>T</sup>
The <sup>T</sup> operator can be found in the matrix math menu.
|