Matrix transposition: Difference between revisions

m
(+Stata)
Line 3,085:
 
=={{header|Stata}}==
Stata matrices are always real, so there is no ambiguity about the transpose operator. Mata matrices, however, may be real or complex. The transpose operator is actually a conjugate transpose, but there is also a '''[https://www.stata.com/help.cgi?mf_transposeonly transposeonly()]''' function.
 
=== Stata matrices ===
<lang stata>. mat a=1,2,3\4,5,6
Line 3,104 ⟶ 3,106:
 
=== Mata ===
<lang stata>: a=1,2,3\4,5,61i
 
: a
1 2 3
+-------------+
1 | 1 2 31i |
2 | 4 5 6 |+-----------+
+-------------+
 
: a'
1 21
+---------+
1 | 1 41 |
2 | 2 5-1i |
3 | 3 6 |+-------+
 
+---------+</lang>
: transposeonly(a)
1
+-------------+
1 | 1 |
2 | 1i |
+---------+</lang>
 
=={{header|Tcl}}==
With core Tcl, representing a matrix as a list of lists:
1,336

edits