Complex Numbers in Matlab
Complex Numbers in Matlab
Unit What
1 Introduction to MATLAB
2 Flow control & Data Structures
3 Plotting
4 Strings & File IO
5 Complex Numbers
6 Combinatorics
7 Linear Algebra
8 Statistics & Data Analysis
9 Polynomial Approximation,
Curve Fitting
10 Root Finding, Numerical
Differentiation
11 Numerical Integration
12 MATLAB GUI
2
Complex Numbers
A number represented byis a complex number where and are two real
numbers and
This representation is defined rectangular form
Imaginary Axis
( x, y )
A complex number can be expressed as a vector
z
on a plane. r
Real Axis
3
Complex Numbers in Polar Form
and
Imaginary Axis
( x, y )
If we have and then and z
are obtained by: r
=
Real Axis
4
Euler’s Formula
Therefore,
5
Representation of Complex Numbers in MATLAB
6
Representation of Complex Numbers in MATLAB
>> z=4+3i;
>> r=abs(z)
r=5
>> thetaRad=angle(z)
thetaRad=0.6435
>> thetaDegree=thetaRad*(180/pi)
thetaDegree=36.87
>> a=r*exp(i*thetaRad)
a=4.0000 + 3.0000i
7
Example:
In MATLAB:
>> z=4*exp(2i)
z =
-1.6646 + 3.6372i
8
Operations on Complex Numbers: SUM
Imaginary Axis
z2
z sum
z1
z2
Real Axis
9
Operations on Complex Numbers: Complex Conjugate
Let ,
• Note(2):
10
Operations on Complex Numbers: Multiplication
;
𝒛 𝑝𝑟𝑜𝑑=𝑥 1 𝑥 2 − 𝑦 1 𝑦 2 +𝑖(𝑥 1 𝑦 2+𝑥 2 𝑦 1)
11
Operations on Complex Numbers: Division
• Again, this operation is not suited to the rectangular form, where it can be costly
or cumbersome. If we move to the polar representation
; ;
12
Application of Complex Numbers
13
Application of complex numbers in algebra
14
Application of complex numbers (1)
15
Application of Complex numbers (2)
𝜋 2𝜋
𝑖( +𝑛 )
4 4
𝑠=𝑒
𝜋
𝑖
4
𝑠 1=𝑒 = 0.7071+𝑖 0.7071
3𝜋
𝑖
4
𝑠 2= 𝑒 =−0.7071+𝑖 0.7071
5𝜋
𝑖
4
𝑠 3 =𝑒 =−0.7071 −𝑖 0.7071
7𝜋
𝑖
4
𝑠 4 =𝑒 = 0.7071−𝑖 0.7071
16
Application of Complex Numbers (3)
Phase= θ
Source:www.wikipedia.org
17
Application of Complex Numbers: Example
E1 E2 E3
18