Azzera filtri
Azzera filtri

Searching using loop in matlab

1 visualizzazione (ultimi 30 giorni)
Sudharsan Srinivasan
Sudharsan Srinivasan il 9 Nov 2017
Risposto: Jan il 9 Nov 2017
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 Commenti
KL
KL il 9 Nov 2017
what is your condition?
Jan
Jan il 9 Nov 2017
Is the number of particles 1:10 or simply 10?

Accedi per commentare.

Risposte (1)

Jan
Jan il 9 Nov 2017
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

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by