Make a dynamic line plot

I have a vector Y and X. I want to make a dynamic 2D line plot that is updated as a new point is added to the X and Y.
X=[1 2 3];
Y=[5 6 7];
for i=0:20
X=[X, i];
Y=[Y,i*2];
?? how to make dynamic Y vs X line plot?
end

Respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 25 de Jul. de 2014

0 votos

close
X=[1 2 3];
Y=[5 6 7];
plot(X,Y)
hold on
for i=4:20
X=[X, i];
Y=[Y,i*2];
plot(i,i*2,'*')
pause(1)
end
Parisa Sadeghi
Parisa Sadeghi el 26 de Jul. de 2017

0 votos

Can the dynamic plot be embedded in a powerpoint presentation in the form of a movie?
Thanks

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

H-H
el 25 de Jul. de 2014

Respondida:

el 26 de Jul. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by