function cidx=plotng01(C) %Plots the connections in C as line segments. % C is the center structure that is constructed % by the neural gas routine. cflag returns 1 % if there are no connections. [m,n]=size(C.M); %A square matrix cidx=0; for i=1:n for j=1:n if C.M(i,j)==1 cidx=cidx+1; Lx(:,cidx)=C.cen(:,i); Ly(:,cidx)=C.cen(:,j); end end end if cidx==0 disp('No connections'); end for i=1:cidx line([Lx(1,i) Ly(1,i)],[Lx(2,i), Ly(2,i)]); if i==1 hold on end end