0

Suppose I have 121 elements and want to get all combinations of 4 elements taken at a time, i.e. 121c4.
Since combnk(1:121, 4) takes a lot of time, I want to go for 2% of that combination by providing:

z = 1:50:length(121c4(:, 1))

For example: 1st row, 5th row, 100th row and so on, up to 121c4, picking only those rows from a 121c4 matrix without generating the complete combination (it's consuming too much for large numbers like 625c4).

4

1 に答える 1

0

組み合わせの順序を定義していない場合は、単に使用しないでください

randi(121,p,4)

セットに必要な組み合わせの数はどこpですか? このアプローチでは、重複を置き換えたい場合とそうでない場合があります。

組み合わせの順序を定義している場合は、それを教えてください。

于 2012-06-18T12:19:25.963 に答える