Language Reference


Transpose Operator:  `

  • matrix `;

The transpose operator, denoted by the backquote character (`), exchanges the rows and columns of matrix, producing the transpose of matrix. If v is the value in the ith row and jth column of matrix, then the transpose of matrix contains v in the jth row and ith column. If matrix contains n rows and p columns, the transpose has p rows and n columns.

For example, the following statements transpose the matrix a, shown in Figure 24.31:

a = {1 2,
     3 4,
     5 6};
b = a`;
print b;

Figure 24.31: Transpose of a Matrix

b
1 3 5
2 4 6



You can also transpose a matrix with the T function .