A moving point along a graph.
71 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Right now, i want to make a point move along the graph. I need some help with that, is there a simple way of making a point move along the plot?
Any help, suggestions or advice will be heavily appreaciated :D
0 comentarios
Respuestas (2)
J. Webster
el 27 de Abr. de 2016
Editada: J. Webster
el 27 de Abr. de 2016
You put the plot inside of a loop and update the position of the point each time...
x = 0:.01:6;
y = sin(x);
px = 0;
py = 0;
for i=1:100
figure(100); %This is so it will replot over the previous figure, and not make a new one.
plot(x,y, px, py,'o');
pause(0.1);
px = px+6/100;
py = sin(px);
end
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!