Graphics Reference
In-Depth Information
exercise A-6
calculate real part, imaginary part, mod (abs) and argument of the following:
(
)
1
13
-
i
i
i
3
+
i
,
+
i
,
i
i
,
i
i
>> Z1 = i^(3+i); Z2 = (1 + sqrt(3) * i)^(1-i); Z3 = (i^i) ^ i; Z4 = i ^ i;
>> format short
>> real ([Z1 Z2 Z3 Z4])
ans =
1.0000 5.3458 0.0000 0.2079
>> imag ([Z1 Z2 Z3 Z4])
ans =
0 1.9759 - 1.0000 0
>> abs ([Z1 Z2 Z3 Z4])
ans =
1.0000 5.6993 1.0000 0.2079
>> angle ([Z1 Z2 Z3 Z4])
ans =
0 0.3541 - 1.5708 0
exercise A-7
Generate a square matrix of order 4 whose elements are uniform [0,1] random numbers. Generate another square
matrix of order 4 whose elements are normal random numbers [0,1]. see generating seeds present, change them
to value ½ and rebuild the two arrays of random numbers.
>> rand (4)
years =
0.9501 0.8913 0.8214 0.9218
0.2311 0.7621 0.4447 0.7382
0.6068 0.4565 0.6154 0.1763
0.4860 0.0185 0.7919 0.4057
Search WWH ::




Custom Search