addprofile

PURPOSE ^

ADDPROFILE - add a profile

SYNOPSIS ^

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

DESCRIPTION ^

ADDPROFILE - add a profile

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

   Usage:
      [A,numprofiles,numpoints,closed]=addprofile(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]=addprofile(A,numprofiles,numpoints,closed,prevplot,root);
0002 %ADDPROFILE - add 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]=addprofile(A,numprofiles,numpoints,closed,prevplot,root)
0009            
0010     title('click to add a point to the new profile, RETURN to exit','FontSize',14)
0011     hold on
0012 
0013     loop=1;
0014     x=[];
0015     y=[];
0016 
0017     while loop
0018 
0019         [xi,yi] = ginput(1);
0020                       
0021         if ~isempty(xi)
0022             x(end+1,1)=xi;
0023             y(end+1,1)=yi;
0024 
0025             %plot everything
0026             undoplots(prevplot);
0027             if length(x)
0028                 plot(x,y,'-rs','MarkerSize',10);
0029             end
0030             plot(x,y,'rs','MarkerSize',10);
0031             plot(x(end),y(end),'rs','MarkerSize',14);
0032 
0033         else
0034 
0035             %check that the profile is not empty
0036             if ~isempty(x)
0037                 A(end+1).x=flipud(x); 
0038                 A(end).y=flipud(y); 
0039                 A(end).name=root; 
0040                 A(end).density=1; 
0041                 numprofiles=numprofiles+1;
0042                 numpoints=numpoints+length(x);
0043                 closed(end+1)=0;
0044             end
0045 
0046             %get out
0047             loop=0;
0048         end
0049     end
0050 end

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