% Draw a polygon, then centralize it and draw the result.

% x and y coordinates of polygon's vertices
x = [4.5000 3.8090 2.6910 2.6910 3.8090];
y = [2.0000 2.9511 2.5878 1.4122 1.0489];

% Set up plot
figure
axis equal
axis([-5 5 -5 5])
hold on

% Draw original polygon
fill(x, y, 'm')
plot(x, y, 'o')

pause() % Wait for user to press Enter

% Centralize and draw
[xC, yC] = Centralize(x, y);
fill(xC, yC, 'b')
plot(xC, yC, 'o')