function [x,XI,YI,ZI,ZI1,ZI2]=profilex(X,Y,sp,Z,Z1,Z2) % % [x,XI,YI,Zout1,Zout2,Zout3]=profilex(X,Y,sp,Z,Z1,Z2) % % profilex extracts profile, at spacing sp, from % the grid X,Y,Z (same profile from Z1 Z2 if present) % X,Y,Z should already be contoured in the current figure window % when profilex is called %*********************************************************************************** % % Jim Merriam % University of Saskatchewan % jim.merriam@usask.ca % (Nov, 1997) % %*********************************************************************************** % disp('EXTRACT A PROFILE FROM THE GRID') disp('CLICK ON THE BEGINNING AND END POINTS OF THE PROFILE') [x_x,y_y]=ginput(2); ll=sqrt((x_x(2)-x_x(1))^2 + (y_y(2)-y_y(1))^2); % length of the profile if ~exist('sp') % if the sampling interval, sp, does not exist prompt sp=input('ENTER THE SAMPLING INTERVAL ALONG THE PROFILE ') end % end if nx=round(ll/sp); % num of samples r=[0:nx]*sp; % sample locations along profile flip='n'; % flag for profile orientation if(x_x(2))