필터 지우기
필터 지우기

Counting number of particles in each position

조회 수: 1 (최근 30일)
Gonzalo Reina
Gonzalo Reina 2019년 11월 25일
편집: Gonzalo Reina 2019년 11월 25일
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.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by