0001 function [A,numprofiles,numpoints,closed]=addprofile(A,numprofiles,numpoints,closed,prevplot,root);
0002
0003
0004
0005
0006
0007
0008
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
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
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
0047 loop=0;
0048 end
0049 end
0050 end