Open In App

Calculate Complex Conjugate Transpose in MATLAB

Last Updated : 21 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The complex conjugate transpose of a matrix is the matrix obtained by transposing the original matrix and then applying the complex conjugate property of complex numbers on each of the element. In mathematics, this is also known as the Hermitian transpose of a matrix.

MATLAB provides two ways of calculating the complex conjugate transpose of a matrix:

  1. The ‘ operator.
  2. The ctranspose function.

Let us see the usage of both with examples.

Method 1: Using ‘ Operator:

Syntax:

vec_B = vec_A’

Example 1:

Matlab




% MATLAB code for ' Operator
vecA = [1+2i 3+3.1i 4-1i;
        2-0.1i -4i 0.4;
        1i 0.23-1i 23+31i];     %matrix
         
% Displaying the original matrix
disp("Original Matrix")
disp(vecA)
 
% Computing the complex conjugate transpose of vecA
vecB = vecA';
 
% Displaying the complex conjugate transpose
disp("Complex Conjugate Transpose of vecA")
disp(vecB)


Output:

 

Method 2: Using ctranspose() 

The ctranspose() function does the same job as the ‘ operator except the fact that it enables operator overloading for classes.

Matlab




% MATLAB code for ctranspose()
vecA = [1+2i 3+3.1i 4-1i;
        2-0.1i -4i 0.4;
        1i 0.23-1i 23+31i];     %matrix
% Displaying the original matrix
disp("Original Matrix")
disp(vecA)
 
% Computing the complex conjugate transpose of vecA
vecB = ctranspose(vecA);
 
% Displaying the complex conjugate transpose
disp("ctranspose of vecA")
disp(vecB)


Output:

 

It can be verified that both the methods give the exact same output.



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads