Calculate the transpose of a matrix of any size.
The transpose of a matrix \( A \) (denoted \( A^T \)) swaps its rows and columns. For a matrix \( A \) of size \( m \times n \), \( A^T \) is \( n \times m \), where:
Example: For \( A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \), \( A^T = \begin{bmatrix} 1 & 3 & 5 \\ 2 & 4 & 6 \end{bmatrix} \).
Advertisement
(Google AdSense will appear here)