MATLAB: I am trying to create a normal random moving point for each individual point in a 3D scatter point. How to go about to do this

3dgaussianMATLABscatter

I am trying to replicate the random movements (gaussian distribution) found in particles and to do that, I have already made a moving plot (in a normal random distribution) but I am trying to have a maybe 5 by 5 number of points with each point having its on random moving point.
Code attached are the moving plot and the scatter plot

Best Answer

What about this?
n = 5;
[X,Y] = meshgrid(1:n); % create mesh
T = 180*rand(n)-90; % initial angles
cla
plot(X(:),Y(:),'ob') % plot starting points
hold on
for i = 1:30
T = T + rand(n)*90 - 45; % increase/decrease angle
X = X + 0.05*cosd(T); % increase/decrease X coordinate
Y = Y + 0.05*sind(T); % increase/decrease Y coordinate
plot(X(:),Y(:),'.r') % plot new coordinates
pause(0.1)
end
hold off