Saturday 3 November 2012

1.4 COMPLEX NUMBERS

1.4 COMPLEX NUMBERS

MATLAB allows operations involving complex numbers. Complex numbers
are entered using function i or j. For example, a number z = 2 + j2 may be
entered in MATLAB as
z = 2+2*i
or
z = 2+2*j
Also, a complex number za
za = 2 2 exp[(π / 4) j]
can be entered in MATLAB as
za = 2*sqrt(2)*exp((pi/4)*j)
It should be noted that when complex numbers are entered as matrix elements
within brackets, one should avoid any blank spaces. For example,
y = 3 + j4 is represented in MATLAB as
y = 3+4*j
If spaces exist around the + sign, such as
u= 3 + 4*j
MATLAB considers it as two separate numbers, and y will not be equal to u.
If w is a complex matrix given as
w =
1 1 2 2
3 2 4 3
+ −
+ +
 
 
j j
j j
then we can represent it in MATLAB as
w = [1+j 2-2*j; 3+2*j 4+3*j]
which will produce the result
w =
1.0000 + 1.0000i 2.0000 - 2.0000i
3.0000 + 2.0000i 4.0000 + 3.0000i
If the entries in a matrix are complex, then the “prime” (‘) operator produces
the conjugate transpose. Thus,
wp = w'
will produce
wp =
1.0000 - 1.0000i 3.0000 - 2.0000i
2.0000 + 2.0000i 4.0000 - 3.0000i
For the unconjugate transpose of a complex matrix, we can use the point transpose
(.’) command. For example,
wt = w.'
will yield
© 1999
wt =
1.0000 + 1.0000i 3.0000 + 2.0000i
2.0000 - 2.0000i 4.0000 + 3.0000i

No comments:

Post a Comment