MATLAB: How to create an animation that plots points on a circle

animationcircledecimalsMATLAB and Simulink Student Suiteplot

I want to create a circle where 0 degrees is 0 and 1 so that the circle ranges from 0-1. I then have a set of data points that are strictly decimals 0<=a<=1. I want an animation that plots these points around the circle in order so that I can watch them plot.

Best Answer

axes('NextPlot', 'add', 'XLim', [-1,1], 'YLim', [-1,1]);
for k = 1:100
data = rand(); % A value between 0 and 1
x = cos(data * 2 * pi);
y = sin(data * 2 * pi);
plot(x, y, 'o');
pause(0.2);
end