I want to generate random particle radius with normally distribution (Gaussian) for 50 particles with a mean of 1 and variance of 0.2. So there are 50 different sizes of particle in the system. That can be done by randn:
% Particle size.
r= 1+sqrt(.2)*randn(1,50) ;
Now I want each particle to have x and y position between -10 and 10.
for i = 1:50 % x -coordinate for each particle
X0in(2*i -1) = 20*(rand(1)-1/2) % y-coordinate for each particle
X0in(2*i) = 20*(rand(1)-1/2) end
How to I label/define the particle one has this radius, particle two is other radius and so on. I need it so that I can calculate the distance between center to center of each particle. Thanks.
Best Answer