I have a set of data and would want to plot the data points like an animation using a for-loop. This is my code:
for k = 1:5000
hplot = plot(plotX(k),hmid2(k),'.b',plotX(k),hamid2(k),'-r');
I am hoping to get a graph like this, but in animation:
Instead, what I got from my animation is:
The lines connecting them disappeared, and the 2nd graph, denoted by hamid2 does not appear in the animated graph.
I'm a newbie so I wonder if there's something I missed out or mistaken?