怎么样把所有点连接起来?
程序代码:
a=80; r1=0.5*a; r2=5.5*a; lab=15*a; lbc=2*pi*r1; lcd=15*a; lah=5.5*a; lef=15.5*a; lhg=15.5*a; lge=pi*r2; ldf=5.5*a; m=76; m1=23; m2=30; m3=23; m4=29; m5=18; m6=29; n=20; dab=lab/m1; dcd=lcd/m3; dah=lah/n; dhg=lhg/m4; def=lef/m6; x=ones(m+1,n+1); y=ones(m+1,n+1); %lab x(1,1)=r1+lab; y(1,1)=0; j=1; for i=2:m1+1 x(i,j)=x(i-1,j)-dab; y(i,j)=y(1,1); end %lbc j=1; for i=m1+2:m1+m2+1 x(i,j)=r1*cos(2*pi-(2*pi/m2*(i-(m1+1)))); y(i,j)=r1*sin(2*pi-(2*pi/m2*(i-(m1+1)))); end %lcd j=1; for i=m1+m2+2:m+1 x(i,j)=x(i-1,j)+dcd; y(i,j)=y(1,1); end %lah i=1; for j=2:n+1 x(i,j)=x(i,1); y(i,j)=y(i,j-1)-dah; end %ldf i=m+1; for j=2:n+1 x(i,j)=x(i,1); y(i,j)=y(i,j-1)+dah; end %lgh j=n+1; for i=2:m4+1 x(i,j)=x(i-1,j)-dhg; y(i,j)=-ldf; end %lge j=n+1; for i=m4+2:m4+m5+1 x(i,j)=r2*cos(3*pi/2-pi/m5*(i-(m4+1))); y(i,j)=r2*sin(3*pi/2-pi/m5*(i-(m4+1))); end %lef j=n+1; for i=m4+m5+2:m+1 x(i,j)=x(i-1,j)+def; y(i,j)=ldf; end for i=2:m for j=2:n x(i,j)=x(i,j-1)+(x(i,n+1)-x(i,1))/n; k=(y(i,n+1)-y(i,1))/(x(i,n+1)-x(i,1)); y(i,j)=y(i,n+1)-k*(x(i,n+1)-x(i,j)); end end plot(x,y,'.')横纵都连起来,有高手么?