%画多边形
function t=test3(n)
n=n+1;
theta=linspace(0,2*pi,n);
theta
D=1;
X_C=0;
Y_C=0;
plot(D*cos(theta)+X_C,D*sin(theta)+Y_C,'g-')
disp(D*cos(theta)+X_C);
disp(D*sin(theta)+Y_C)
grid on
axis square
>> test3(4)
theta =
0 1.5708 3.1416 4.7124 6.2832
1.0000 0.0000 -1.0000 -0.0000 1.0000
0 1.0000 0.0000 -1.0000 -0.0000