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 个评论
Walter Roberson
2017-12-14
Under what conditions should sharing of subcarriers be permitted or not permitted?
回答(1 个)
Walter Roberson
2017-12-14
Putting everyone into the same group is a valid solution to the problem you have posted.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!