How to cluster the users based on the minimum distance with respect to the base station.
2 次查看(过去 30 天)
显示 更早的评论
I have generated the code with respect to three users and computed the distance of three users with respect to the base station.
N_UE=3
Xmax=1; % x-coordinate for base station
Ymax=1; % y-coordinate for base station
radius=2; %coverage radius
xsd=ones(1,N_UE)*Xmax;
ysd=ones(1,N_UE)*Ymax;
rrx=radius*sqrt(rand(1,N_UE));
thetarx=2*pi*rand(1,N_UE);
ang=0:0.01:2*pi;
xrx=xsd+rrx.*cos(thetarx); %random position of receivers-->x-coordinate
yrx=ysd+rrx.*sin(thetarx); %random position of receivers-->x-coordinate
th = 0:pi/100:2*pi;
xunit = radius * cos(th) + Xmax;
yunit = radius * sin(th) + Ymax;
figure
plot(xunit, yunit);
hold on
plot(ysd,xsd,'r^')
hold on
PPP=[xrx.', yrx.'];
plot(PPP(:,1),PPP(:,2),'k*')
dist2=sqrt((xrx-xsd).^ 2+(yrx-ysd).^2)
The code executes and gives me the result.
As i am having three users the users can be clustered in 5 possible ways
{a},{b},{c}
{ab},{c}
{bc},{a}
{ac},{b}
{abc}.
the clustering needs to be done by computing the minimum difference in distance with respect to the base station.
Could anyone please help me on this.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!