expconcatenate

PURPOSE ^

EXPCONCATENATE - modify several profiles to concatenate them

SYNOPSIS ^

function expconcatenate(newfile,oldfile)

DESCRIPTION ^

EXPCONCATENATE - modify several profiles to concatenate them
 
   this routine reads the profiles of oldfile and enables the user to concatenate
   the profiles by clicking on the tips he/she wants to link

   Usage:
      expconcatenate(newfile,oldfile)

   See also EXPMASTER, EXPDOC

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function expconcatenate(newfile,oldfile)
0002 %EXPCONCATENATE - modify several profiles to concatenate them
0003 %
0004 %   this routine reads the profiles of oldfile and enables the user to concatenate
0005 %   the profiles by clicking on the tips he/she wants to link
0006 %
0007 %   Usage:
0008 %      expconcatenate(newfile,oldfile)
0009 %
0010 %   See also EXPMASTER, EXPDOC
0011  
0012 %Some checks
0013 if nargin~=2 | nargout
0014     error('expconcatenate usage: expconcatenate(newfile,oldfile)')
0015 elseif ~exist(oldfile)
0016     error(['expconcatenate error message: the file ' oldfile  'does not exist'])
0017 elseif exist(newfile),
0018     choice=input(['A file ' newfile ' already exists, do you want to modify it? (y/n)'],'s');
0019     if ~strcmpi(choice,'y'),
0020         error('no modification done ... exiting');
0021     end
0022 end
0023 
0024 %Get exp oldfile
0025 [path root ext ver]=fileparts(oldfile);
0026 A=expread(oldfile,1);
0027 numprofiles=size(A,2);
0028 
0029 %Figure out how nany plots have been done so far
0030 g=get(gca,'children'); 
0031 prevplot=length(g);
0032 
0033 %plot existing profile
0034 hold on
0035 numpoints=0;
0036 closed=zeros(numprofiles,1);
0037 for i=1:numprofiles
0038     plot(A(i).x,A(i).y,'-r','MarkerSize',10);
0039 
0040     %update numpoints
0041     numpoints=numpoints+size(A(i).x,1);
0042 
0043     %figure out if the profile is closed or not
0044     if (A(i).x(1)==A(i).x(end) & A(i).y(1)==A(i).y(end))
0045         closed(i)=1;
0046     end
0047 end
0048 
0049 %call merge profile routine
0050 [A,numprofiles,numpoints,closed]=mergeprofiles(A,numprofiles,numpoints,closed,prevplot,root);
0051 
0052 hold off
0053 
0054 %write contour using expwrite
0055 title('New file written, exiting','FontSize',14);
0056 expwrite(A,newfile);

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