Info
This question is closed. Reopen it to edit or answer.
OFDMA grouping of users
1 view (last 30 days)
Show older comments
could anyone help me to execute the following code as I am getting error
N_UE=[2 4 6 8 10];
for t= 1:length(N_UE)
s=randperm(N_UE(t))
numGroups = 5; % Need to divide s up into 5 groups
divisions = sort(randperm(s, numGroups) , 'ascend')
divisions = [0, divisions, s]
groups = cell(1, numGroups);
for k = 1 : numGroups
indexes = divisions(k)+1:divisions(k+1);
% Assign users to the kth group:
usersInThisGroups = length(indexes);
fprintf('Assigning %d users (indexes %d to %d) to group %d.\n', ...
usersInThisGroups, divisions(k)+1,divisions(k+1), k);
groups{k} = s(indexes);
end
celldisp(groups); % Display groups in command window.
end
1 Comment
ANKUR KUMAR
on 20 Dec 2017
Is this forum a joke for you and few your batchmates. The same to same program is already asked by someone and you are posting it again. Another program for the same problem is also asked by the different user. In the past 20 minutes, I have seen 3 people asking the problem of the same question and for the same program.
I think you are asking the same question twice on this forum. https://in.mathworks.com/matlabcentral/answers/373805-how-to-solve-the-error
Try using debugger to resolve your problem.
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!