function segplot(x,y,ind);
%function segplot(x,y,ind);
if nargin==2
     ind=y;
     y=x;
     x=1:length(x);
end
hold off
ii=ind(1):ind(length(ind));
plot(x(ii),y(ii),'i')
hold on
ii=[ind(1):ind(2)];
plot(x(ii),y(ii))
for i=2:length(ind)-1
      
     ii=[ind(i):ind(i+1)];
     plot(x(ii),y(ii),['c',int2str(rem(i,15)+1)])
end
hold off

