Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

could anyone help me to solve the issue.

1 view (last 30 days)
Prabha Kumaresan
Prabha Kumaresan on 21 Mar 2018
Closed: MATLAB Answer Bot on 20 Aug 2021
If there are 4 users in the system say(1,2,3,4) and i want to form pair such that each pairs should contain 2 users under the condition user present in one pair should not be present in other pair.with respect to 4 users 2 pairs can be formed with 3 different combinations combination1 - (12),(34) combination2 - (13),(24) combination3 - (14),(23)
I have written the code
unused_rows=1:4
while ~isempty(unused_rows)
N_UE_rows=2;
rows=unused_rows(randsample(length(unused_rows),N_UE_rows))
[~,idx]=find(ismember(unused_rows,rows))
unused_rows(idx)=[]
end
If i run the code i can get the result for only one combination but how to get the result for the other two combinations.
could anyone help me to solve this issue

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!