-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhist2.py
More file actions
61 lines (46 loc) · 1.32 KB
/
hist2.py
File metadata and controls
61 lines (46 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import numpy as np
import matplotlib.pyplot as plt
FreqReUse=9; NoUpLink=12
SubX=np.random.uniform(2000, -2000, size=[9, 12])
SubY=np.random.uniform(2000, -2000, size=[9, 12])
PlusShift=12000;
MinusShift=-12000;
Cell_x0=SubX[0,:];
Cell_y0=SubY[0,:];
Cell_x1=SubX[1,:];
Cell_y1=SubY[1,:]+PlusShift;
Cell_x2=SubX[2,:]+PlusShift;
Cell_y2=SubY[2,:]+PlusShift;
Cell_x3=SubX[3,:]+PlusShift;
Cell_y3=SubY[3,:];
Cell_x4=SubX[4,:]+PlusShift;
Cell_y4=SubY[4,:]+MinusShift;
Cell_x5=SubX[5,:];
Cell_y5=SubY[5,:]+MinusShift;
Cell_x6=SubX[6,:]+MinusShift;
Cell_y6=SubY[6,:]+MinusShift;
Cell_x7=SubX[7,:]+MinusShift;
Cell_y7=SubY[7,:];
Cell_x8=SubX[8,:]+MinusShift;
Cell_y8=SubY[8,:]+PlusShift;
ShiftX=np.array([Cell_x0, Cell_x1, Cell_x2, Cell_x3, Cell_x4, Cell_x5, Cell_x6, Cell_x7, Cell_x8])
ShiftY=np.array([Cell_y0, Cell_y1, Cell_y2, Cell_y3, Cell_y4, Cell_y5, Cell_y6, Cell_y7, Cell_x8])
plt.figure(1)
plt.plot(ShiftX, ShiftY, 'bo')
Dist=np.sqrt(ShiftX**2+ShiftY**2)
'''''''''
np.sqrt((ShiftX[0,0])**2+(ShiftY[0,0])**2)
np.sqrt((ShiftX[0,:])**2+(ShiftY[0,:])**2)
plt.grid()
plt.plot(ShiftX[0,:], ShiftY[0, :], 'r*')
plt.figure(2)
ShiftY[0,0]
ShiftX[0,0]
plt.figure(1)
plt.plot(ShiftX, ShiftY, 'bo')
Dist=np.sqrt(ShiftX**2+ShiftY**2)
'''''''''
NormalDistribution=np.random.randn(FreqReUse, NoUpLink)
mu=0
SD=6
LogNormal=mu+SD*NormalDistribution