function Polygon(a0,b0,radius,n_sides) % % displaying a Polygon. % % a0, b0 - its center, % radius - the radius enclosing the polygon, % n_sides - the number of sides. % x_first=a0+radius; y_first=b0; for j=1:n_sides x_next=a0+radius*cos(2*j*pi/n_sides); y_next=b0+radius*sin(2*j*pi/n_sides); line([x_first x_next], [y_first y_next]); text(x_first,y_first,num2str(j)) x_first=x_next; y_first=y_next; end % j