Calculate Complex Conjugate Transpose in MATLAB


The Complex Conjugate Transpose is a mathematical operation performed on a matrix of complex numbers. It is also known as Hermitian Transpose of Matrix. In this operation, first the transpose of the matrix is taken and after that the conjugate of each element of the matrix.

For example, if a there is a complex matrix M, then the complex conjugate transpose of this matrix will be M* that is obtained by taking transpose of M and then replacing each element with its complex conjugate. The complex conjugate of a complex number is simply determined by changing the sign of imaginary part of the number.

The complex conjugate transpose operation finds applications in the linear algebra and signal processing operations.

In this article, we will learn to calculate complex conjugate transpose of a matrix in MATLAB.

MATLAB provides the following two common ways to calculate complex conjugate transpose of a complex matrix:

  • `'` Operator

  • `ctranspose()` Function

Now, let us discuss the implementation of both methods individually in the MATLAB programming.

Complex Conjugate Transpose using `'` Operator

In MATLAB, we can use the `'` operator to calculate the complex conjugate transpose of a complex matrix.

Syntax

matB = matA'

Here, matA is the original complex matrix, the `'` operator is used to calculate complex conjugate transpose, then matB stores the complex conjugate transposed matrix.

The following MATLAB program demonstrates the implementation of `'` operator to calculate the complex conjugate of a complex matrix.

Example

% MATLAB program to demonstrate the use of `'` operator
% Create a sample complex matrix
matA = [2 + 2i, 3 + 1i, 1 + 4i;
6 + 7i, 7 + 8i, 8 + 9i;
10 + 11i, 2 + 5i, 3 + 7i];
% Display the original matrix
disp('Original Matrix:');
disp(matA);
% Calculate the complex conjugate transpose of matA
matB = matA';
% Display the complex conjugate transposed matrix
disp('Complex Conjugate Transposed Matrix:')
disp(matB);    

Output

Original Matrix:
    2 +  2i    3 +  1i    1 +  4i
    6 +  7i    7 +  8i    8 +  9i
   10 + 11i    2 +  5i    3 +  7i
Complex Conjugate Transposed Matrix:
    2 -  2i    6 -  7i   10 - 11i
    3 -  1i    7 -  8i    2 -  5i
    1 -  4i    8 -  9i    3 -  7i

Explanation

In this MATLAB program, we start by defining a 3 x 3 complex matrix “matA”. Then, we display the original matrix using the “disp()” function. After that we calculate the complex conjugate transpose of “matA” by using the `'` operator and stores this transposed matrix in “matB”. Finally, we display the complex conjugate transposed matrix “matB” by using the “disp” function.

Complex Conjugate Transpose using `ctranspose()` Function

MATLAB has a built-in function “ctranspose()” to calculate the complex conjugate of a matrix.

Syntax

matB = ctranspose(matA);

Here, the “matA” is the original complex matrix, and the “matB” is the complex conjugate transpose of the matrix “matA”.

The following MATLAB program illustrates the implementation of the `ctranspose()` function to calculate the complex conjugate transpose of a matrix.

Example

% MATLAB program to demonstrate the use of `ctranspose` function
% Create a sample complex matrix
matA = [2 + 2i, 3 + 1i, 1 + 4i;
6 + 7i, 7 + 8i, 8 + 9i;
10 + 11i, 2 + 5i, 3 + 7i];
% Display the original matrix
disp('Original Matrix:');
disp(matA);
% Calculate the complex conjugate transpose of matA
matB = ctranspose(matA);
% Display the complex conjugate transposed matrix
disp('Complex Conjugate Transposed Matrix:')
disp(matB);    

Output

Original Matrix:
    2 +  2i    3 +  1i    1 +  4i
    6 +  7i    7 +  8i    8 +  9i
   10 + 11i    2 +  5i    3 +  7i
Complex Conjugate Transposed Matrix:
    2 -  2i    6 -  7i   10 - 11i
    3 -  1i    7 -  8i    2 -  5i
    1 -  4i    8 -  9i    3 -  7i

Conclusion

In this MATLAB program, we start by defining a complex matrix “matA”. Then, we display the original matrix using the “disp()” function. Next, we calculate the complex conjugate transpose of “matA” by using the `ctranspose()` function and stores this transposed matrix in “matB”. Finally, we display the complex conjugate transposed matrix “matB” by using the “disp” function.

This is how we can easily calculate the complex conjugate transpose of a complex matrix in MATLAB.

Updated on: 18-Jul-2023

135 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements