transpose, .'

Syntax

Description

example

B = A.' computes the nonconjugate transpose of A.

B = transpose(A) is an alternate way to execute A.', but is rarely used. It enables operator overloading for classes.

Examples

expand all

Transpose of Real Matrix

Create a 4-by-4 matrix.

A = magic(4)
A =

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

Find the transpose of A.

B = A.'
B =

    16     5     9     4
     2    11     7    14
     3    10     6    15
    13     8    12     1

The result, B, has the same elements as A, but the row and column index for each element are interchanged.

Transpose of Complex Matrix

Create a 2-by-4 matrix containing complex elements.

A = [1 3 4-1i 2+2i; 0+1i 1-1i 5 6-1i]
A =

   1.0000 + 0.0000i   3.0000 + 0.0000i   4.0000 - 1.0000i   2.0000 + 2.0000i
   0.0000 + 1.0000i   1.0000 - 1.0000i   5.0000 + 0.0000i   6.0000 - 1.0000i

Find the transpose of A.

B = A.'
B =

   1.0000 + 0.0000i   0.0000 + 1.0000i
   3.0000 + 0.0000i   1.0000 - 1.0000i
   4.0000 - 1.0000i   5.0000 + 0.0000i
   2.0000 + 2.0000i   6.0000 - 1.0000i

The result, B, is a 4-by-2 matrix. The non-conjugate transpose does not change the sign of the imaginary parts of the complex elements.

Input Arguments

expand all

A — Input arrayvector | matrix | cell array | categorical array | datetime array | duration array | calendarDuration array | structure field

Input array, specified as a vector or matrix of any numeric, logical, or char data type, or as a cell array, categorical array, datetime array, duration array, calendarDuration array, or structure field.

Complex Number Support: Yes

More About

expand all

Nonconjugate Transpose

The nonconjugate transpose of a matrix interchanges the row and column index for each element, reflecting the elements across the main diagonal, with the diagonal elements themselves unchanged. This operation does not affect the sign of the imaginary parts of complex elements.

For example, if B = A.' and A(3,2) is 1+1i, then the element B(2,3) is 1+1i.

Tips

  • The complex conjugate transpose operator, A', also negates the sign of the imaginary portion of the complex elements in A.

See Also

| |

Was this topic helpful?