MATLAB: Dynamic graph of polygonial lines

figurelineplotting

Hi, I am trying to solve this issue for couple of weeks. I want to have a single 2d figure on which I will draw not-closed 3 polygonial lines of different colors.
So pseudocode should be something like this:
draw(path1,path2,path3);
for i=1:10
path1=f1();
path2=f2();
path3=f3();
draw(path1, path2, path3);
User should just watch it, without need to click anything.
Can you give me some hint, please.
Thank you

Best Answer

doc pause
doc drawnow
Example:
hold all
h1 = plot(rand(100,1));
h2 = plot(rand(100,1));
h3 = plot(rand(100,1));
drawnow
hold off
for k=1:10
set(h1,'ydata',rand(100,1))
set(h2,'ydata',rand(100,1))
set(h3,'ydata',rand(100,1))
pause(0.5)
end