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