could anyone tell me how to group users in a random manner such that sharing of subcarriers takes place.

2 次查看(过去 30 天)
N_UE=[2 4 6 8 10];
N_SC=[20 30 40 50 60];
--------------------------------
for t= 1:length(N_UE)
for r = 1:length(N_SC)
Xmax=1;
Ymax=1;
radius=5;
xsd=ones(1,N_UE(t))*Xmax;
ysd=ones(1,N_UE(t))*Ymax;
rrx=radius*sqrt(rand(1,N_UE(t)));
thetarx=2*pi*rand(1,N_UE(t));
ang=0:0.01:2*pi;
xrx=xsd+rrx.*cos(thetarx);
yrx=ysd+rrx.*sin(thetarx);
---------------------------------
as=4;
bs=10;
Lsigma=as+(bs-as)*rand(1,N_UE(t));
Lshadow=10.^(randn(1,N_UE(t)).*(Lsigma/10));
ae=3;
be=5;
Lexp=ae+(be-ae)*rand(1,N_UE(t));
for k=1:N_SC(r)
for j=1:N_UE(t)
dist2(j)=sqrt((xrx(j)-xsd(j))^2+(yrx(j)-ysd(j))^2);
G(j,k)=(rand(j,k)*Lshadow(j))/dist2(j).^Lexp(j);
end
end
-------------------------------------------
siz = size(G);
idx = sub2ind(siz, randi([1,N_UE(t)], 1, siz(2)), 1:siz(2));
C = zeros(siz);
C(idx) = G(idx);
end
end
  2 个评论
Prabha Kumaresan
Prabha Kumaresan 2017-12-14
subcarriers are alloted to the users and the result is stored in C.Now users needs to form group in a random manner.When user grouping takes place subcarriers needs to be shared among the users in the group.

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2017-12-14
Putting everyone into the same group is a valid solution to the problem you have posted.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by