Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Sort indices to groups with all pairs sampled

1 回表示 (過去 30 日間)
Leore Heim
Leore Heim 2019 年 11 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
I would to sort a vector of indices
[i = 1 : n]
to groups of size m such that all index pairs appear in at least one group.
For example:
i = 1 : 5;
m = 3;
g = [ 1 2 3
1 4 5
2 4 5
3 4 5];
The main difficulty for me is to keep the number of groups to a minimum.
Please note that mod(n, m) ~= 0.
Thank you in advance.

回答 (1 件)

Rik
Rik 2019 年 11 月 24 日
It looks like nchoosek should do the trick for you.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by