Info

此问题已关闭。 请重新打开它进行编辑或回答。

could anyone help me to solve the issue.

1 次查看(过去 30 天)
Prabha Kumaresan
Prabha Kumaresan 2018-3-21
关闭: MATLAB Answer Bot 2021-8-20
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

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by