Circular moving point at a set velocity
Show older comments
The function I am looking to create is one that takes multiple circular plots, of different radius, and have a point follow the graph at its own distinct velocity, for as long as possible. The code I have so far is:
radius=[10 15 20 30]
velocity=[5 2.5 15 20]
colors=['y','m','c','r'] % This is to just make the points different colors
hold on
for i=1:4 %Loop to create multiple circles
th=0:pi/50:2*pi;
xunit=radius(i)*cos(th);
yunit=radius(i)*sin(th);
h=plot(xunit,yunit);
p=plot(xunit(1),yunit(1),'o','MarkerFaceColor',colors(i)); %creates a point on each graph
end
hold off
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!