|
Umal-qura university
|
səhifə | 19/30 | tarix | 23.12.2023 | ölçüsü | 0,73 Mb. | | #156716 |
| Signal and Systems Manual - v2fullpart of z and represented as y = Imag {z}. That is:
z = (x, y)
= x + iy
= Re {x} + i Imag {x}
Another way to represent a complex number is in polar form. In polar form, the vector is defined by its length (r) or magnitude (|z|) and its direction (θ). A rectangular form can be converted into polar form using formulas:
|z| = r = (x2 + y2)½
θ = arctan (y/x)
z = r ejθ
where ejθ = cos θ + i sin θ, and known as the Euler’s formula.
Function Description
==================================================
real returns the real part x of z imag returns the imaginary part y of z abs returns the length r of z
angle returnsthedirectionθofz
conj returns the complex conjugate ẕ of z
==================================================
Here are some examples:
>_r_=_abs(z)_r_=_5_>>_θ_=_angle(z)_θ_=_0.9273_Example'>Example_To_define_the_complex_number,_for_instance,_z_=_(3,_4)_in_matlab_write_in_matlab_editor_>>_z_=_3_+_4i_z_=_3.0000_+_4.0000i___Example'>Example
To define the complex number, for instance, z = (3, 4) in matlab write in matlab editor >> z = 3 + 4i
z =
3.0000 + 4.0000i
Example
To find the real and imaginary parts of the complex number, write >> x = real(z)
x =
3
>> y = imag(z)
y =
4
Example
To find the length and direction of z, write >> r = abs(z)
r =
5
>> θ = angle(z)
θ =
0.9273
Example
To find the conjugate of z, write
zx =
>> zx = conj(z) 3.0000 – 4.0000i
-------------------------TASK 01--------------------------
Write matlab function zprint, which takes a complex number and returns it real part, imaginary part, magnitude, phase in radians, and phase in degrees.
A sample run of program is:
>> zprint(z)
Z = X + jY Magnitude Phase Ph(deg) 3 4 5 0.927 53.13
Dostları ilə paylaş: |
|
|