function varargout=eurasia(res,scal) % XY=EURASIA(res,scal) % EURASIA(...) % Only makes a plot % % Finds the coordinates of Eurasia % % INPUT: % % res 0 The standard, default values % N Splined values at N times the resolution % scal Scale this to something else % % OUTPUT: % % XY Closed-curved coordinates of the continent % % Last modified by fjsimons-at-alum.mit.edu, June 3rd, 2004 defval('res',0) defval('scal',0) if res==0 fnpl=fullfile(getenv('IFILES'),'COASTS','Eurasia.mat'); else fnpl=fullfile(getenv('IFILES'),'COASTS',sprintf('Eurasia-%i.mat',res)); end if exist(fnpl,'file')==2 % & 1==3 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 axis([345 555 5 80]) else varargout{1}=XY; end else if res==0 % First part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% c11=[0 77.5]; cmn=[180 8]; clf [axlim,handl,XY1]=plotcont(c11,cmn,[],360); delete(handl) % Get rid of common NaNs XY1=XY1(~isnan(XY1(:,1)) & ~isnan(XY1(:,2)),:); % Second part %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% c11=[350 50]; cmn=[360 36]; [axlim,handl,XY2]=plotcont(c11,cmn,[],0); delete(handl) % Get rid of common NaNs XY2=XY2(~isnan(XY2(:,1)) & ~isnan(XY2(:,2)),:); XY=[XY1 ; XY2]; % Now make sure the distances aren't huge 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(:)]; % Experiment with % a=[100:300]; % plot(XY(a,1),XY(a,2)); XY=XY([420:1605],:); % Experiment with -> See "check this out" % Form closed contour a1=[1:408]; a2=[495:610]; a3=[1137:1175]; a4=[611:1132]; XY=[XY(a1,:) ; XY(a2,:) ; XY(a3,:) ; ... XY(a4,:)]; % Oops - there is a fourth part c11=[180 69]; cmn=[190 64]; [axlim,handl,XY3]=plotcont(c11,cmn,[],360); XY=[XY ; XY3]; XY=[XY(1:1078,:) ; XY(1086:3000,:)]; XY=XY(~isnan(XY(:,1)) & ~isnan(XY(:,2)),:); plot(XY(:,1),XY(:,2),'LineW',2,'Color','k'); axis equal axis([345 555 5 80]) % Check this out %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% hold on for index=[1:size(XY,1)] 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(0.01) end % Check this out %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% eval(sprintf('save %s XY',fnpl)) else XY=eurasia(0); XYb=bezier(XY,res); XY=XYb; eval(sprintf('save %s XY',fnpl)) end end