Biomedical Engineering Reference
In-Depth Information
A.1.5 Complex Numbers
MATLAB stores all numbers as complex numbers and uses either
i
or
j
to represent the
imaginary component of complex numbers. In MATLAB
z
¼
3
þ
i
4 and
z
¼
3
þ
j
4 are
equivalent, that is
>>
z
¼
3
þ
4j
gives
z
¼
3.0000
þ
4.0000i
and
>>
z
¼
3
þ
4i
gives
z
¼
3.0000
þ
4.0000i
As mentioned previously, here we use the symbol
i
for current (as in Example A.1) and the
symbol
. The polar form
for complex numbers is also valid in MATLAB; that is, for any arbitrary real value
j
for the complex numbers. MATLAB, however, defaults to the symbol
i
x
and
y
,
z
¼
x
þ
jy
¼j
z
j
e
j
y
where
q
x
j
z
j¼
2
þ
y
2
tan
1
y
x
y
¼
MATLAB has many built-in functions for working with complex numbers, with a few
essential ones given in Table A.1.
TABLE A.1
MATLAB Commands for Complex
Numbers with
z
¼
x
þ
jy
Value
Syntax
Re(
z
)
real(
z
)
Im(
z
)
imag(
z
)
j
z
j¼
p
x
2
þ
y
2
abs(
z
)
tan
1
x
y ¼
angle(
z
)