how can I make the line animated for x2, y2 ?

2 visualizaciones (últimos 30 días)
yudhi
yudhi el 21 de Sept. de 2017
Comentada: yudhi el 21 de Sept. de 2017
x=[0 100 100 0 0]; y=[0 0 100 100 0]; x1=[50 50 50 50 50 60 70 80 80 80 80 80]; y1=[0 10 20 30 40 40 40 40 50 60 70 80]; plot(x,y,x1,y1)
  1 comentario
Jan
Jan el 21 de Sept. de 2017
"Make it animated" is not an clear description of what you want. Do you want one line appear after the other, should the it be displayed as growing polygon, or should a line disappear when the new line is drawn? Please do not let the readers guess, what you want.

Iniciar sesión para comentar.

Respuesta aceptada

KSSV
KSSV el 21 de Sept. de 2017
x=[0 100 100 0 0]; y=[0 0 100 100 0];
x1=[50 50 50 50 50 60 70 80 80 80 80 80];
y1=[0 10 20 30 40 40 40 40 50 60 70 80];
plot(x,y);
hold on
for i = 1:length(x1)
plot(x1(1:i),y1(1:i),'r')
pause(0.2)
end

Más respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by