how the subcarrier allocation to users in a random manner

In the image given below rows represent 5 users and columns represent 20 subcarriers. each user needs to have atleast 3 or 4 subcarriers. If user one is using subcarrier 1,3,5 and 7 it should not be used by user 2,3,4 and 5. so it should be marked as 0. similar procedure needs to get repeated for all the users.

1 comentario

KSSV
KSSV el 24 de Nov. de 2017
YOu can have a look on fucntions ismember and intersect to get the common elements in different sets.

Iniciar sesión para comentar.

Respuestas (2)

KSSV
KSSV el 24 de Nov. de 2017
a=[ 1 12 6 25 8 30
10 9 3 20 4 9
5 2 15 7 3 6] ;
used = sort([1 5 9 2 6 3 25 20 8 3 9 6]) ;
idx = ismember(a,used) ;
iwant = zeros(size(a)) ;
iwant(~idx) = a(~idx) ;
carrier_list = reshape( randperm(NumberOfSubcarriers), NumberOfUsers, [])
Now each column tells you which subcarriers one user is allocated.
For the case where the number of subcarriers is not an exact multiple of the number of users, then
num_extra = mod(NumberOfSubcarriers, NumberOfUsers);
baseNumber = NumberOfSubcarriers - num_extra;
carrier_list = reshape( randperm(baseNumber), NumberOfUsers), []);
carrier_list(end+1, randperm(NumberOfUsers, num_extra) ) = baseNumber+1 : NumbeOfSubcarries;
Now each column tells you which subcarriers one user is allocated, with 0 for no subcarrier (some users may have one more subcarrier than the others; the split is as even as possible.)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Nov. de 2017

Respondida:

el 24 de Nov. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by