Hi Shuvagata,
MATLAB graphics doesn't directly have an animation function, but a fairly simple 'for' loop can be implemented to do animations:
if true
clc; close all;clear all;
t = 0: (2*pi) / 100: 2*pi; %Creating points
a = cos(t) + sin(t)*i; %Finding the points
for i=1:size(a,2)
compass(a(i));
drawnow;
end
The important part is to do the drawnow in the loop, so your graphics changes show up. Hope that helps.