for loop to show all alternatives

5 ビュー (過去 30 日間)
Hassan
Hassan 2012 年 8 月 3 日
i need to write for loop to print all the alternatives such as.
i have N nodes (10) and need to store all their alternatives in an array is K (4);
1 2 3 4; 1 2 3 5; 1 2 3 6; 1 2 3 7; 1 2 3 8; 1 2 3 9; 1 2 3 10; 1 2 4 5; 1 2 4 6; 1 2 4 7; 1 2 4 8; 1 2 4 9; 1 2 4 10; . . . . thanks & BR
  1 件のコメント
Oleg Komarov
Oleg Komarov 2012 年 8 月 3 日
Is a for loop mandatory?

サインインしてコメントする。

回答 (1 件)

Oleg Komarov
Oleg Komarov 2012 年 8 月 3 日
nchoosek(1:10,4)

カテゴリ

Help Center および File ExchangeDiscrete Math についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by