Hello,
I need to create a loop that loops through 3 gas components but they cannot be put together. Basically i need to be able to use a nested for loop to get 1 and 3, 1 and 2, 2 and 3 but cannot have 1 and 1, 2 and 2 or 3 and 3... any help would be appreciated

回答 (1 件)

Rik
Rik 2019 年 10 月 10 日
編集済み: Rik 2019 年 10 月 10 日

0 投票

Use perms to generate the list of all combinations and loop through the rows. Use nchoosek if you need unique combinations.

カテゴリ

ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索

質問済み:

2019 年 10 月 10 日

編集済み:

Rik
2019 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by