%animatedSquare() -> figure
%Author: James Atlas
%Description:
%  Animates a square moving from left to right on the figure screen
function []=animatedSquare()
axis manual;

patch([0 5 5 0], [0 0 5 5], 'green');
for index = [1:10]
    
    x = [index (index + 1) (index + 1) index];
    y = [1 1 2 2];
    p = patch(x,y,'red');
    axis([0 10 0 10]);
    pause(1);
    delete(p);
end