-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathantennatower.m
More file actions
133 lines (123 loc) · 3.25 KB
/
antennatower.m
File metadata and controls
133 lines (123 loc) · 3.25 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
function f = antennatower(xx)
x=xx(1);
y=xx(2);
buildings = [
345.46 10.641
-658.81 250.18
-1658.4 130.6
1086.3 -1190.2
60.992 994.47
341.58 449.06
58.325 -70.656
842.6 1649.8
270.43 504.49
-259.97 -58.293
893.77 -1007.7
-346.38 -304.41
230.34 -104.96
-2025.2 2074.2
-769.92 -348.3
-486.14 425.69
930.53 251.23
1110.5 -111.45
995.53 202.18
1695.4 -1170.2
-1282.9 -846.2
-2008.3 1571.8
1234.7 -397.96
572.59 -295.87
1300.9 1280.2
-1018.5 208.44
-1354.2 1373.7
-1126 1283.3
433.44 -710.15
-2167.9 1305.8
-467.25 -2459.1
177.93 -810.69
3775.6 -974.52
1193.2 -240.89
-42.225 1052.9
-667.23 1040.5
-882.98 -1936.2
617.9 -64.303
1209 -432.93
259.14 -1421.4
-1125 59.025
-807.35 300.77
-1381.8 1581.2
-104.13 1646.3
-330.36 -396.69
905.84 -1275.7
-437.4 -439.65
513.93 -618.32
396.62 2122.6
-543.92 -1625.6
-251.39 -429.99
883.72 -440.9
-135.42 -167.3
991.55 -331.12
326.38 -337.49
572.25 261.68
281.7 -519.91
169.32 589.81
497.99 -344.95
44.119 606.62
463.29 -670.29
543.28 356.02
1013.8 160.02
427.04 -158.54
-299.36 856.55
543.62 -329.81
475.18 233.36
-504.61 617.39
271.92 40.203
-809.45 1086.2
18.177 485.97
120.7 36.099
-502.32 -893.01
811.36 -52.832
542.05 460.66
-702.95 -597.83
-524.43 148.43
-98.772 -280.4
524.33 109.66
-184.32 -90.092
-139.01 -171.3
-167.06 239.73
109.16 -85.166
-28.964 251.73
-145.13 426.01
472.56 111.2
-618.25 581.87
341.38 3.5348
-14.557 808.34
487.96 261.04
-59.352 -136.21
-303.58 49.494
189.45 675.34
109.57 -496.32
64.114 352.13
101.05 63.342
377.34 1420.9
1524.1 -913.9
679.74 192.51
266.9 162.55];
[rr, cc] = size(buildings);
d = 0;
num = 0;
for i=1:rr
d = d + sqrt((x - buildings(i,1))^2 + (y - buildings(i,2))^2);
if sqrt((x - buildings(i,1))^2 + (y - buildings(i,2))^2) <= 1000
num = num + 1;
end
end
lambda1 = 1;
lambda2 = 1e6;
f = lambda1*d + lambda2*1/num;
return;
xx=[127.59, 34.404];
plot(buildings(:,1),buildings(:,2),'bo');
hold;
circle(xx,1000,1000,'r-');
xlabel('\itx');
ylabel('\ity');