Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Sort indices to groups with all pairs sampled

1 visualización (últimos 30 días)
Leore Heim
Leore Heim el 24 de Nov. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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.

Respuestas (1)

Rik
Rik el 24 de Nov. de 2019
It looks like nchoosek should do the trick for you.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by