Page 21 - MATLAB an introduction with applications
P. 21
6 ——— MATLAB: An Introduction with Applications
Table 1.7 Complex number functions
Function Description
conj(x) Computes the complex conjugate of the complex number x. Thus, if
x is equal to a + ib, then conj(x) will be equal to a – ib.
angle(x) Computes the real portion of the complex number x.
real(x) Computes the imaginary portion of the complex number x.
imag(x) Computes the absolute value of magnitude of the complex number x.
abs(x) Computes the angle using the value of atan2(imag(x), real(x)); thus,
the angle value is between –π and π.
Table 1.8 Arithmetic operations with complex numbers
Operation Result
c 1 + c 2 (a 1 + a 2 ) + i(b 1 + b 2 )
c 1 + c 2 (a 1 – a 2 ) + i(b 1 – b 2 )
c 1 y c 2 (a 1 a 2 – b 1 b 2 ) + i(a 1 b 2 – a 2 b 1 )
c 1 aa b b a b b a
c 2 12 2 b 1 2 i 2 1 b 2 1
2
2
2
a
a
2
2
2
2
|c 1 | 2 2
a 1 b (magnitude or absolute value of c 1 )
1
c 1 * a 1 – ib 1 (conjugate of c 1 )
(Assume that c 1 = a 1 + ib 1 and c 2 = a 2 + ib 2 .)
1.5 VARIABLE NAMES
A variable is a name made of a letter or a combination of several letters and digits. Variable names can be up to
63 (in MATLAB 7) characters long (31 characters on MATLAB 6.0). MATLAB is case sensitive. For instance,
XX, Xx, xX and xx are the names of four different variables. It should be noted here that not to use the names of
a built-in functions for a variable. For instance, avoid using: sin, cos, exp, sqrt, ..., etc. Once a function name is
used to define a variable, the function cannot be used.
1.6 PREDEFINED VARIABLES
MATLAB includes a number of predefined variables. Some of the predefined variables that are available to use
in MATLAB programs are summarized in Table 1.9.
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09