After long 7 month of training and research i reached a success. Here is what i've achieved
clc,clear
px = 5*rand(10,1);
py = 5*rand(10,1);
plot(px,py,'.r')
axis([-1 1 -1 1]*20)
hold on
t = 360*rand(size(px));
for i = 1:20
dx = 0.5*cosd(t);
dy = 0.5*sind(t);
t = t + 90*(0.5-rand(size(px)));
plot([px px+dx]', [py py+dy]')
px = px + dx;
py = py + dy;
h = plot(px,py,'.b');
pause(0.2)
delete(h)
end
hold off
Best Answer