# MATLAB: I am trying to simulate Brownian motion where the initial position of the particles are generated by random number generators. I need to freeze the particles when it reaches a particular position, how can i do it? kindly help

brownian motionparticles

I am trying to simulate Brownian motion where the initial position of the particles are generated by random number generators. I need to freeze the particles when it reaches a particular position, how can i do it? kindly help

Positions(StillActive) = Positions(StillActive) + randn(sum(StillActive),1);