function varargout=england(res,scal) % XY=ENGLAND(res,scal) % ENGLAND(...) % Only makes a plot % % Finds the coordinates of England, Scotland, and Wales. % In a ridiculously exaggerated version of the truth. % % INPUT: % % res 0 The standard, default values % N Splined values at N times the resolution % scal Scale this to a really Great Britain % % OUTPUT: % % XY Closed-curved coordinates of the continent % % Last modified by fjsimons-at-alum.mit.edu, May 12th, 2004 defval('res',0) defval('scal',4) if res==0 fnpl=fullfile(getenv('IFILES'),'COASTS','England.mat'); else fnpl=fullfile(getenv('IFILES'),'COASTS',sprintf('England-%i.mat',res)); end if exist(fnpl,'file')==2 load(fnpl) if scal~=0 XY(:,1)=scale(XY(:,1),[200 330]); XY(:,2)=scale(XY(:,2),[46 -70]); end if nargout==0 plot(XY(:,1),XY(:,2),'k-'); axis equal; grid on else varargout{1}=XY; end else if res==0 c11=[353 59]; cmn=[360 49.75]; clf [axlim,handl,XY1]=plotcont(c11,cmn); delete(handl) XY1=XY1(21:end,:); XY1=XY1(~isnan(XY1(:,1))& ~isnan(XY1(:,2)),:); c11=[0 59]; cmn=[2 49.75]; [axlim,handl,XY2]=plotcont(c11,cmn,[],360); delete(handl) XY2=XY2(3003:4000,:); XY2=XY2(~isnan(XY2(:,1))& ~isnan(XY2(:,2)),:); XY=[XY1 ; XY2]; % This portion from PLOTCONT xx=XY(:,1); yy=XY(:,2); d=sqrt((xx(2:end)-xx(1:end-1)).^2+(yy(2:end)-yy(1:end-1)).^2); dlev=3; p=find(d>dlev*nanmean(d)); nx=insert(xx,NaN,p+1); ny=insert(yy,NaN,p+1); XY=[nx(:) ny(:)]; XY=XY(~isnan(XY(:,1))& ~isnan(XY(:,2)),:); % Form closed contour XY=[XY(1:51,:) ; XY(62:72,:) ; XY(52:60,:)]; plot(XY(:,1),XY(:,2),'LineW',2,'Color','k'); axis equal axis([352 365 48 60]) eval(sprintf('save %s XY',fnpl)) % Check this out hold on for index=1:length(XY) pm(index)=plot(XY(index,1),XY(index,2),'o'); set(pm(index),'MarkerE','k','MarkerF',[1 1 1]*(index-1)/length(XY)) title(num2str(index)) pause end else XY=england(0); XYb=bezier(XY,res); XY=XYb; eval(sprintf('save %s XY',fnpl)) end end