removeprofile

PURPOSE ^

REMOVEPROFILE - delete a profile

SYNOPSIS ^

function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root);

DESCRIPTION ^

REMOVEPROFILE - delete a profile

   this script is used by expmaster as an elementary operation
   on an ARGUS profile

   Usage:
      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root);
0002 %REMOVEPROFILE - delete a profile
0003 %
0004 %   this script is used by expmaster as an elementary operation
0005 %   on an ARGUS profile
0006 %
0007 %   Usage:
0008 %      [A,numprofiles,numpoints,closed]=removeprofile(A,numprofiles,numpoints,closed,prevplot,root)
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         %some checks
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             %get closest profile
0029             [profsel indsel]=closestpoint(A,numprofiles,xi,yi);
0030 
0031             if ismember(profsel,selection)
0032                 %profile was in selection, remove it
0033                 selection(find(selection==profsel))=[];
0034                 %back to red
0035                 plot(A(profsel).x,A(profsel).y,'-r','MarkerSize',10);
0036             else
0037                 %add the profile to the list to be removed
0038                 selection(end+1)=profsel;
0039                 %in blue
0040                 plot(A(profsel).x,A(profsel).y,'-b','MarkerSize',10);
0041             end
0042         else
0043             %remove the profiles
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

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003