Borrar filtros
Borrar filtros

Counting number of particles in each position

1 visualización (últimos 30 días)
Gonzalo Reina
Gonzalo Reina el 25 de Nov. de 2019
Editada: Gonzalo Reina el 25 de Nov. de 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.

Respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by