Main Content

transpose,”。

Transpose vector or matrix

Description

example

B =一个”。returns the nonconjugate transpose of一个, that is, interchanges the row and column index for each element. If一个contains complex elements, then一个。”does not affect the sign of the imaginary parts. For example, if一个(3,2)is1 + 2我andB = A.', then the elementB(2,3)is also1 + 2我.

B = transpose(一个)is an alternate way to execute一个。”and enables operator overloading for classes.

Examples

collapse all

Create a matrix of real numbers and compute its transpose.Bhas the same elements as一个, but the rows ofBare the columns of一个and the columns ofBare the rows of一个.

一个= magic(4)
一个=4×416 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
B = A.'
B =4×416 5 9 4 2 11 7 14 3 10 6 15 13 8 12 1

Create a matrix containing complex elements and compute its nonconjugate transpose.Bcontains the same elements as一个, except the rows and columns are interchanged. The signs of the imaginary parts are unchanged.

一个= [1 3 4-1i 2+2i; 0+1i 1-1i 5 6-1i]
一个=2×4 complex1.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
B = A.'
B =4×2 complex1.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

Input Arguments

collapse all

Input array, specified as a vector or matrix.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical|char|string|struct|cell|categorical|datetime|duration|calendarDuration
Complex Number Support:Yes

Tips

  • The complex conjugate transpose operator,一个“, also negates the sign of the imaginary part of the complex elements in一个.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.

Version History

Introduced before R2006a