Searching using loop in matlab
2 ビュー (過去 30 日間)
古いコメントを表示
I have n (number of particles) = 1:10. These particles flow in the system and i want to check if for certain condition is satisfied, then the particles collide and I compute collision. Importantly, I have to check every possible combinations of n for collision to happen. Any suggestions on how can I do this in a loop ?
2 件のコメント
回答 (1 件)
Jan
2017 年 11 月 9 日
Perhaps you mean this:
for i1 = 1:10
for i2 = 1:10
if i1 ~= i2
check collision between the particle i1 and i2
end
end
end
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!