animation - How to do an animated plot in matlab -
i wondering if knew how animation plot of x = (dataset of 1000 points) y = (dataset of 1000 points) plot(x,y) big problem these datasets trying plot , or x,y coordinates opposed function know how plot via animation. i tried frames in loop gave me dots , didn't join them in line graph couldn't watch path being traced out. code used was for = 1:length(dataset1) pause(0.1) plot(dataset1(i),dataset2(i)) draw on end looks close. not sure draw on command though. see if code here inspires solve case - %// sample x , y values assumed demo. x = 1:1000; y = x.^2; %// plot starts here figure,hold on %// set x , y limits of plot xlim([min(x(:)) max(x(:))]) ylim([min(y(:)) max(y(:))]) %// plot point point k = 1:numel(x) plot(x(k),y(k),'-') %// choose own marker here %// matlab pauses 0.001 sec before moving on execue next %%// instruction , creating animation effect pause(0.001); end