transposeMatrix
The transpose of a matrix is a fundamental operation in linear algebra. To transpose a matrix means to interchange its rows and columns. If a matrix A has dimensions m x n, meaning it has m rows and n columns, its transpose, denoted as A^T or A', will have dimensions n x m. Each element A[i][j] in the original matrix becomes the element A^T[j][i] in the transposed matrix. In simpler terms, the element in the i-th row and j-th column of the original matrix moves to the j-th row and i-th column of the transposed matrix.
For example, consider a 2x3 matrix:
Its transpose would be a 3x2 matrix:
The operation of transposing a matrix has several useful properties. For instance, the transpose of a transpose