For loop every combination
2 ビュー (過去 30 日間)
古いコメントを表示
Hello community,
I want for loops to check every element from 1 to n with all other elements. so letst say n=4
So I want to check Number 1 with 2,3 and 4// check number 2 with 3 and 4// and check number 3 with 4.
Can I build one or maybe two for loops for something like that?
2 件のコメント
Scott MacKenzie
2021 年 6 月 16 日
Please explain what you mean by "check".
When you say "check Number 1 with 2,3 and 4" what sort of operation or result are you contemplating?
回答 (1 件)
Sulaymon Eshkabilov
2021 年 6 月 16 日
Go over this help documentation and will understand how and what to do with [for ... end] loop iteration
https://www.mathworks.com/help/matlab/ref/for.html
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!