clear clc clf hold off x = [1 3 3 1 1] y = [1 1 3 3 1] plot(x, y) axis([-5 5 -5 5]) th = 0 dth = .05 n = floor(2*pi/dth) for i = 1:1000 th = th + dth; [xx, yy] = rotate(x, y, th); plot(xx, yy) axis([-5 5 -5 5] ) axis square pause(.01) end