SlideShare a Scribd company logo
11
Complex Numbers in MATLAB
Lecture Series - 2
by
Shameer Koya
2
Complex Plane
Real Axis x
y
Imaginary Axis
3
Form of Complex Number
Real Axis
Imaginary Axis
( , )x y

z
r
x iy z
4
Conversion Between Forms
cosx r 
siny r 
Polar to Rectangular:
Rectangular to Polar:
2 2
r x y 
1
ang( ) tan
y
x
 
 z
5
Euler’s Formula
cos sin (cos sin )r ir r i      z
i
re
z
i
re r

Common Engineering Notation:
cos sini
e i
  
6Convert the complex number to polar form:
4 3i z
2 2 2 2
(4) (3) 5r x y    
1 3
tan 36.87 0.6435 rad
4
 
  
5 36.87 or z
0.6435
5 i
ez
7Convert the complex number to polar form:
4 3i  z
2 2 2 2
( 4) (3) 5r x y     
1 13 3
tan 180 tan
4 4
180 36.87 143.13 2.498 rad
   
   
 
   
2.498
5 i
ez
8
Convert the complex number to
rectangular form:
2
4 i
ez
4cos2 1.6646x   
4sin2 3.6372y  
1.6646 3.6372i  z
9Addition of Two Complex Numbers
1 1x iy 1z
2 2x iy 2z
1 1 2 2
1 2 1 2( )
x iy x iy
x x i y y

   
   
sum 1 2z z + z
A geometric interpretation of addition is
shown on the next slide.
10
Addition of Two Complex Numbers
Real Axis
Imaginary Axis
1z
2z
2z
sumz
11
Subtraction of Two Complex Numbers
1 1x iy 1z
2 2x iy 2z
A geometric interpretation of subtraction
is shown on the next slide.
1 1 2 2
1 2 1 2
( )
( )
x iy x iy
x x i y y

   
   
diff 1 2z z - z
12
Subtraction of Two Complex Numbers
Real Axis
Imaginary Axis
1z
2z
 2z
diffz
 2z
13Multiplication in Polar Form
1
1
i
re
1z
2
2
i
r e
2z
  1 2
1 2
1 2
( )
1 2
i i
i
re r e
rr e
 
 


prod 1 2z = z z
14Division in Polar Form
1
1
i
re
1z
2
2
i
r e
2z
 
 
1
2
1 2
1
2
( )1
2
i
i
i
re
r e
r
e
r


 


1
div
2
z
z =
z
15
Multiplication in Rectangular Form
1 1x iy 1z
2 2x iy 2z
1 1 2 2
2
1 2 1 2 2 1 1 2
( )( )x iy x iy
x x ix y ix y i y y
  
   
prodz
1 2 1 2 1 2 2 1( )x x y y i x y x y   prodz
16
Complex Conjugate
Start with
i
x iy re
  z
The complex conjugate is
i
x iy re 
  z
2 2 2
The product of and is
( )( )
z z
x y r  z z
17
Division in Rectangular Form
1 1
2 2
x iy
x iy

 

1
div
2
z
z
z
1 1 2 2
2 2 2 2
1 2 1 2 2 1 1 2
2 2
2 2
1 2 1 2 2 1 1 2
2
( )( )
( )( )
( )
( )
x iy x iy
x iy x iy
x x y y i x y x y
x y
x x y y i x y x y
r
 

 
  


  

divz
18
Exponentiation of Complex Numbers:
Integer Power
N
powerz = (z)
( )
cos sin
i N N iN
N N
re r e
r N ir N
 
 
 
 
powerz
cos Re( )iN
N e 
 
sin Im( )iN
N e 
 
MATLAB Complex Operations
 Complex number
 Construct complex data from real and imaginary
components
>> c = complex(a,b)
>> z = 3 + 4i
z =
3.0000 + 4.0000i
>> z = 3 + 4j
z =
3.0000 + 4.0000i
19
20
MATLAB Complex Number Operations:
Entering in Polar Form
>> z = 5*exp(0.9273i)
z =
3.0000 + 4.0000i
>> z = 5*exp((pi/180)*53.13i)
z =
3.0000 + 4.0000i
This result indicates that polar to rectangular
conversion occurs automatically upon entering the
number in polar form.
21
Rectangular to Polar Conversion
>> z = 3 + 4i
z =
3.0000 + 4.0000i
>> r = abs(z)
r =
5
>> theta = angle(z)
theta =
0.9273
22
Real and Imaginary and Conjugate
>>real(z)
ans =
3
>> imag(z)
ans =
4
>> z1 = conj(z)
z1 =
3.0000 - 4.0000i
Complex Algebra
 Z1 = 3+4i
 Z2 = 2-5i
 Z3 = Z1+Z2
 Z4 = Z1-Z2
 Z5 = Z1*Z2
 Z6 = Z1/Z2
23
Plotting complex number
 Use simple ‘plot’ function
 Plot (real, imaginary)
 Use ‘compass’ function
 Compass (z)
24
Exercise
 a= 3+2i b= 4+5i
 Find
 Magnitude of a
 Angle of a
 Real part of a
 Imaginary part of a
 Conjugate of a
 Plot a and b using ‘plot’ and ‘compass’
 a+b, a-b, a/b, a*b, a2
25
26
Thanks
Questions ??

More Related Content

PPTX
Integration by Parts & by Partial Fractions
PPT
Odd and even functions
PDF
Lesson 19: Partial Derivatives
PDF
1 complex numbers
PPT
L5 infinite limits squeeze theorem
PDF
Gram schmidt orthogonalization | Orthonormal Process
PDF
龍騰數學統測必考高頻率題型
PPT
Riemann sumsdefiniteintegrals
Integration by Parts & by Partial Fractions
Odd and even functions
Lesson 19: Partial Derivatives
1 complex numbers
L5 infinite limits squeeze theorem
Gram schmidt orthogonalization | Orthonormal Process
龍騰數學統測必考高頻率題型
Riemann sumsdefiniteintegrals

What's hot (20)

PDF
Lesson 16: Inverse Trigonometric Functions (slides)
PDF
Integration
PPT
INTEGRATION BY PARTS PPT
PDF
Integral calculus
PPT
Complex Numbers
PPT
Limits and continuity
PPTX
Complex variables
PDF
Orthogonal sets and basis
PDF
Function of several variables
PDF
X2 T01 03 argand diagram
PPT
Distance-in-the-Coordinate-Plane (2).ppt
PPSX
Complex number
PPT
Exponential functions
PPTX
Complex analysis
PPTX
Transformations of functions
PPS
Matrix Operations
PPTX
Power series & Radius of convergence
PDF
X2 t07 04 reciprocal functions (2012)
PDF
Fourier sine and cosine series
PPT
Linear vector space
Lesson 16: Inverse Trigonometric Functions (slides)
Integration
INTEGRATION BY PARTS PPT
Integral calculus
Complex Numbers
Limits and continuity
Complex variables
Orthogonal sets and basis
Function of several variables
X2 T01 03 argand diagram
Distance-in-the-Coordinate-Plane (2).ppt
Complex number
Exponential functions
Complex analysis
Transformations of functions
Matrix Operations
Power series & Radius of convergence
X2 t07 04 reciprocal functions (2012)
Fourier sine and cosine series
Linear vector space
Ad

Viewers also liked (20)

PDF
X2 t01 01 arithmetic of complex numbers (2013)
PPTX
Matlab ploting
PPTX
Matlab matrices and arrays
DOC
Complex Number From Jayant for TV
PPTX
2D Plot Matlab
PPTX
Matlab introduction
PPTX
Matlab m files and scripts
PDF
Introto pl cs
PPTX
Microprocessor and Microcontroller lec4
PPTX
Matlab dc circuit analysis
PPTX
Matlab polynimials and curve fitting
PDF
1 Bilangan Kompleks
PPTX
Microprocessor and Microcontroller lec5
PDF
Plc analog input output programming
PDF
Plc analog Tutorial
PPT
Chapter 2 ladder
PPTX
Matlab dc motor modeling
PPTX
Matlab simpowersystem
PPTX
Mat lab solving equations simulink
PPTX
Matlab solving rlc circuit
X2 t01 01 arithmetic of complex numbers (2013)
Matlab ploting
Matlab matrices and arrays
Complex Number From Jayant for TV
2D Plot Matlab
Matlab introduction
Matlab m files and scripts
Introto pl cs
Microprocessor and Microcontroller lec4
Matlab dc circuit analysis
Matlab polynimials and curve fitting
1 Bilangan Kompleks
Microprocessor and Microcontroller lec5
Plc analog input output programming
Plc analog Tutorial
Chapter 2 ladder
Matlab dc motor modeling
Matlab simpowersystem
Mat lab solving equations simulink
Matlab solving rlc circuit
Ad

Similar to Matlab complex numbers (20)

PDF
1. introduction to complex numbers
PPTX
Complex numbers org.ppt
PDF
1 ca nall
PPTX
An introdcution to complex numbers jcw
PPT
Complex Numbers And Appsfeb
PDF
Complex number, polar form , rectangular form
PPT
Complex Number I - Presentation
PDF
Math20001 dec 2015
PPTX
presentation.pptx
PDF
05 De-Moivre's Theorem.pdf undergrade presentation
PPT
complex numbers 1
PDF
3) Polar Form(mathematics) subject slides.pdf
PDF
Complex Numbers
PDF
complex numbers and functions.PDF
PDF
Theme 4 Notes Complex Numbers (1).pdf
PPT
complex numbers
PDF
Complex Numbers and Functions. Complex Differentiation
PPTX
M.sheela complex ppt
PPTX
complex number
PPTX
Advance Engineering Mathematics Complex Numbers a.pptx
1. introduction to complex numbers
Complex numbers org.ppt
1 ca nall
An introdcution to complex numbers jcw
Complex Numbers And Appsfeb
Complex number, polar form , rectangular form
Complex Number I - Presentation
Math20001 dec 2015
presentation.pptx
05 De-Moivre's Theorem.pdf undergrade presentation
complex numbers 1
3) Polar Form(mathematics) subject slides.pdf
Complex Numbers
complex numbers and functions.PDF
Theme 4 Notes Complex Numbers (1).pdf
complex numbers
Complex Numbers and Functions. Complex Differentiation
M.sheela complex ppt
complex number
Advance Engineering Mathematics Complex Numbers a.pptx

More from Ameen San (20)

PDF
Application of Capacitors to Distribution System and Voltage Regulation
PDF
Distribution System Voltage Drop and Power Loss Calculation
PDF
Load Characteristics
PDF
ELECTRICAL DISTRIBUTION TECHNOLOGY
PPTX
Stepper motor
PDF
PLC application
PDF
PLC arithmatic functions
PDF
PLC data types and addressing
PDF
PLC Counters
PDF
PLC Traffic Light Control
PDF
PLC Timers
PDF
PLC Internal Relays
PDF
PLC Intro to programming
PDF
PLC Logic Circuits
PDF
PLC input and output devices
PDF
PLC Applications
PPT
Protection Devices and the Lightning
PPT
Protection
PPT
Relays
PPT
Circuit Breakers
Application of Capacitors to Distribution System and Voltage Regulation
Distribution System Voltage Drop and Power Loss Calculation
Load Characteristics
ELECTRICAL DISTRIBUTION TECHNOLOGY
Stepper motor
PLC application
PLC arithmatic functions
PLC data types and addressing
PLC Counters
PLC Traffic Light Control
PLC Timers
PLC Internal Relays
PLC Intro to programming
PLC Logic Circuits
PLC input and output devices
PLC Applications
Protection Devices and the Lightning
Protection
Relays
Circuit Breakers

Recently uploaded (20)

PPTX
communication and presentation skills 01
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPT
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
communication and presentation skills 01
Fundamentals of Mechanical Engineering.pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Exploratory_Data_Analysis_Fundamentals.pdf
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Information Storage and Retrieval Techniques Unit III
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Abrasive, erosive and cavitation wear.pdf
Categorization of Factors Affecting Classification Algorithms Selection
86236642-Electric-Loco-Shed.pdf jfkduklg
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
Nature of X-rays, X- Ray Equipment, Fluoroscopy

Matlab complex numbers

  • 1. 11 Complex Numbers in MATLAB Lecture Series - 2 by Shameer Koya
  • 2. 2 Complex Plane Real Axis x y Imaginary Axis
  • 3. 3 Form of Complex Number Real Axis Imaginary Axis ( , )x y  z r x iy z
  • 4. 4 Conversion Between Forms cosx r  siny r  Polar to Rectangular: Rectangular to Polar: 2 2 r x y  1 ang( ) tan y x    z
  • 5. 5 Euler’s Formula cos sin (cos sin )r ir r i      z i re z i re r  Common Engineering Notation: cos sini e i   
  • 6. 6Convert the complex number to polar form: 4 3i z 2 2 2 2 (4) (3) 5r x y     1 3 tan 36.87 0.6435 rad 4      5 36.87 or z 0.6435 5 i ez
  • 7. 7Convert the complex number to polar form: 4 3i  z 2 2 2 2 ( 4) (3) 5r x y      1 13 3 tan 180 tan 4 4 180 36.87 143.13 2.498 rad               2.498 5 i ez
  • 8. 8 Convert the complex number to rectangular form: 2 4 i ez 4cos2 1.6646x    4sin2 3.6372y   1.6646 3.6372i  z
  • 9. 9Addition of Two Complex Numbers 1 1x iy 1z 2 2x iy 2z 1 1 2 2 1 2 1 2( ) x iy x iy x x i y y          sum 1 2z z + z A geometric interpretation of addition is shown on the next slide.
  • 10. 10 Addition of Two Complex Numbers Real Axis Imaginary Axis 1z 2z 2z sumz
  • 11. 11 Subtraction of Two Complex Numbers 1 1x iy 1z 2 2x iy 2z A geometric interpretation of subtraction is shown on the next slide. 1 1 2 2 1 2 1 2 ( ) ( ) x iy x iy x x i y y          diff 1 2z z - z
  • 12. 12 Subtraction of Two Complex Numbers Real Axis Imaginary Axis 1z 2z  2z diffz  2z
  • 13. 13Multiplication in Polar Form 1 1 i re 1z 2 2 i r e 2z   1 2 1 2 1 2 ( ) 1 2 i i i re r e rr e       prod 1 2z = z z
  • 14. 14Division in Polar Form 1 1 i re 1z 2 2 i r e 2z     1 2 1 2 1 2 ( )1 2 i i i re r e r e r       1 div 2 z z = z
  • 15. 15 Multiplication in Rectangular Form 1 1x iy 1z 2 2x iy 2z 1 1 2 2 2 1 2 1 2 2 1 1 2 ( )( )x iy x iy x x ix y ix y i y y        prodz 1 2 1 2 1 2 2 1( )x x y y i x y x y   prodz
  • 16. 16 Complex Conjugate Start with i x iy re   z The complex conjugate is i x iy re    z 2 2 2 The product of and is ( )( ) z z x y r  z z
  • 17. 17 Division in Rectangular Form 1 1 2 2 x iy x iy     1 div 2 z z z 1 1 2 2 2 2 2 2 1 2 1 2 2 1 1 2 2 2 2 2 1 2 1 2 2 1 1 2 2 ( )( ) ( )( ) ( ) ( ) x iy x iy x iy x iy x x y y i x y x y x y x x y y i x y x y r               divz
  • 18. 18 Exponentiation of Complex Numbers: Integer Power N powerz = (z) ( ) cos sin i N N iN N N re r e r N ir N         powerz cos Re( )iN N e    sin Im( )iN N e   
  • 19. MATLAB Complex Operations  Complex number  Construct complex data from real and imaginary components >> c = complex(a,b) >> z = 3 + 4i z = 3.0000 + 4.0000i >> z = 3 + 4j z = 3.0000 + 4.0000i 19
  • 20. 20 MATLAB Complex Number Operations: Entering in Polar Form >> z = 5*exp(0.9273i) z = 3.0000 + 4.0000i >> z = 5*exp((pi/180)*53.13i) z = 3.0000 + 4.0000i This result indicates that polar to rectangular conversion occurs automatically upon entering the number in polar form.
  • 21. 21 Rectangular to Polar Conversion >> z = 3 + 4i z = 3.0000 + 4.0000i >> r = abs(z) r = 5 >> theta = angle(z) theta = 0.9273
  • 22. 22 Real and Imaginary and Conjugate >>real(z) ans = 3 >> imag(z) ans = 4 >> z1 = conj(z) z1 = 3.0000 - 4.0000i
  • 23. Complex Algebra  Z1 = 3+4i  Z2 = 2-5i  Z3 = Z1+Z2  Z4 = Z1-Z2  Z5 = Z1*Z2  Z6 = Z1/Z2 23
  • 24. Plotting complex number  Use simple ‘plot’ function  Plot (real, imaginary)  Use ‘compass’ function  Compass (z) 24
  • 25. Exercise  a= 3+2i b= 4+5i  Find  Magnitude of a  Angle of a  Real part of a  Imaginary part of a  Conjugate of a  Plot a and b using ‘plot’ and ‘compass’  a+b, a-b, a/b, a*b, a2 25