linalg(deprecated)/transpose - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : linalg(deprecated)/transpose

linalg(deprecated)

 transpose
 compute the transpose of a matrix

 Calling Sequence transpose(A)

Parameters

 A - m x n matrix or vector

Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Transpose], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The matrix transpose of A is computed.  The result is an n x m matrix. The [i,j]th element of the result is equal to the [j,i]th element of A. The result inherits the indexing function (for example, diagonal or sparse) of A, if it has one.
 • If A is a vector, then it is treated as if it were a column vector; transpose(A) would therefore be a row vector.
 • The command with(linalg,transpose) allows the use of the abbreviated form of this command.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Transpose], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{array}\left(\left[\left[1,2,3\right],\left[4,5\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {4}& {5}& {{\mathrm{?}}}_{{2}{,}{3}}\end{array}\right]$ (1)
 > $\mathrm{transpose}\left(A\right)$
 $\left[\begin{array}{cc}{1}& {4}\\ {2}& {5}\\ {3}& {{A}}_{{2}{,}{3}}\end{array}\right]$ (2)
 > $B≔\mathrm{array}\left(\mathrm{diagonal},1..2,1..2,\left[\left(1,1\right)=5\right]\right)$
 ${B}{≔}\left[\begin{array}{cc}{5}& {0}\\ {0}& {{\mathrm{?}}}_{{2}{,}{2}}\end{array}\right]$ (3)
 > $\mathrm{transpose}\left(B\right)$
 $\left[\begin{array}{cc}{5}& {0}\\ {0}& {{B}}_{{2}{,}{2}}\end{array}\right]$ (4)
 > $C≔\mathrm{array}\left(\left[1,2,3\right]\right)$
 ${C}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\end{array}\right]$ (5)
 > $\mathrm{Ct}≔\mathrm{transpose}\left(C\right)$
 ${\mathrm{Ct}}{≔}{\mathrm{transpose}}{}\left({C}\right)$ (6)
 > $\mathrm{evalm}\left(C\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{Ct}\right)$
 $\left[\begin{array}{ccc}{1}& {2}& {3}\\ {2}& {4}& {6}\\ {3}& {6}& {9}\end{array}\right]$ (7)
 > $\mathrm{evalm}\left(\mathrm{Ct}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}C\right)$
 ${14}$ (8)

 See Also