How can I make x circles move within a space?
Show older comments
I've been able to make a circle move inside a rectangle with this code:

if (r(2)+R >=b)
r(2)=b-R;
v(2)=-v(2)
end
plot(r(1)+R*x,r(2)+R*y,'-b','MarkerSize',28*R)
rectangle('Position',[0,0,a,b])
axis equal
pause(dt/deltat)
end
how do I do the same thing, but with n circles?
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!