0001 function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root);
0002
0003
0004
0005
0006
0007
0008
0009
0010 title('click on the profiles to be removed, RETURN to exit','FontSize',14)
0011 hold on
0012
0013 loop=1;
0014 selection=[];
0015
0016 while loop
0017
0018
0019 if numprofiles==0
0020 disp('no profile to be removed')
0021 return
0022 end
0023
0024 [xi,yi] = ginput(1);
0025
0026 if ~isempty(xi)
0027
0028
0029 [profsel indsel]=closestpoint(A,numprofiles,xi,yi);
0030
0031 if ismember(profsel,selection)
0032
0033 selection(find(selection==profsel))=[];
0034
0035 plot(A(profsel).x,A(profsel).y,'-r','MarkerSize',10);
0036 else
0037
0038 selection(end+1)=profsel;
0039
0040 plot(A(profsel).x,A(profsel).y,'-b','MarkerSize',10);
0041 end
0042 else
0043
0044 selection=sort(selection);
0045 for i=1:length(selection),
0046 numprofiles=numprofiles-1;
0047 numpoints=numpoints-length(A(selection(i)-(i-1)).x);
0048 A(selection(i)-(i-1))=[];
0049 closed(selection(i)-(i-1))=[];
0050 end
0051 loop=0;
0052 end
0053 end
0054 end