-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotgNBAndUE_2DPositions.m
35 lines (26 loc) · 1.04 KB
/
plotgNBAndUE_2DPositions.m
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
function plotgNBAndUE_2DPositions(gNBPos,UEPos,gNBNums,r1,r2)
% plotgNBAndUE_2DPositions(GNBPOS,UEPOS,GNBNUMS) plots gNB and UE positions.
numgNBs = numel(gNBNums);
colors = getColors(numel(gNBPos));
figure;
hold on;
lengendstr = cell(1,numgNBs);
% Plot position of each gNB
for gNBIdx = 1:numgNBs
plot(gNBPos{gNBNums(gNBIdx)}(1), gNBPos{gNBNums(gNBIdx)}(2), ...
'Color',colors(gNBNums(gNBIdx),:),'Marker','^', ...
'MarkerSize',11,'LineWidth',2,'MarkerFaceColor',colors(gNBNums(gNBIdx),:));
lengendstr{gNBIdx} = sprintf('gNB%d',gNBIdx);
end
% Plot UE position
plot(UEPos(1),UEPos(2), 'ko', 'MarkerSize', 10, 'LineWidth',2, 'MarkerFaceColor','k');
if ~(isempty(r1) && isempty(r2))
% TODO: Plot r1 circumference and r2 circumference
center = [ 0 0; 0 0];
viscircles(center, [r1 r2],'Color','r','LineStyle','--');
end
axis equal;
legend([lengendstr 'UE'])
xlabel('X Position [m]')
ylabel('Y Position [m]')
end