Digital Signal Processing Reference
In-Depth Information
0.9273
»
real(z)
% Real part of a complex number z
ans ¼
3
»
imag(z)
% Imaginary part of a complex number z
ans ¼
4
»
exp(j*pi/4)
% Polar form of a complex number
ans
¼
0.7071 + 0.7071i
The following shows examples of array operations. Krauss, Shure, and Little (1994) and Stearns
(2003) give detailed explanation for each operation.
»
x ¼ [1 2; 3 4]
% Initialize 2 2 matrixes
x 12
34
» y ¼ [-4 3; -2 1]
y -4 3
-2 1
»
x+y
% Add two matrixes
ans ¼
-3 5
15
»
x*y
% Matrix product
ans ¼
-8 5
-20 13
»
x.*y
% Array element product
ans
¼
-4 6
-6 4
»
x'
% Matrix transpose
ans ¼
13
24
»
2.^x
% Exponentiation: matrix x contains each exponent
ans ¼
24
816
Search WWH ::




Custom Search