function out = digitizebathy % Interactively gather navigational chart soundings data % To get data, first display the chart (e.g. a tiff file) in the plot windoww. % Then start function with: % out = digitizebathy % or % out = [out; digitizebathy] to continue building % % The function prompt for each depth value in the command window % Output will be 3 columns of x,y,depth % % i = 1; h(i) = input('Enter depth of first point: '); while h(i)~=999 [x(i),y(i)] = ginput(1); hold on han = plot(x(i),y(i),'r*'); set(han,'linew',2,'markersize',10) hold off % text(x(i),y(i),num2str(h(i))) i = i+1; disp('Enter depth of next point (999 to exit) ...') dep = input(['Press ENTER if same as last time (' (num2str(h(i-1))) '): ']); if isempty(dep) h(i) = h(i-1); else h(i) = dep; end end h(end) = []; out = [x(:) y(:) h(:)];