Azzera filtri
Azzera filtri

Counting number of particles in each position

1 visualizzazione (ultimi 30 giorni)
Gonzalo Reina
Gonzalo Reina il 25 Nov 2019
Modificato: Gonzalo Reina il 25 Nov 2019
Ok , so I have an array conatining particle trajectories from a random walk in which each column is a particle trajectory and it looks something like this for example
r = [1 3 4 5 6; 0 3 1 2 4; 2 4 5 6 7]
The particles have a fixed step and my goal is to find the number of particles in each possible position in every step in a very efficient way. I want to do this outside the for loop that generates the particle trajectories. I have a row vector conatining the possible particle positions for example
possteps = 1:10;
I want to use the approach used in this anwer
but I am having trouble implementing it so that i get the particle counts for every step (for every row in r)
If anyone has any suggestions on how to do did effiiently for big arrays of r and possteps I would be very grateful.

Risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by