Counting number of particles in each position

3 Ansichten (letzte 30 Tage)
Gonzalo Reina
Gonzalo Reina am 25 Nov. 2019
Bearbeitet: Gonzalo Reina am 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.

Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by