Warning, /utils/matlab/cs_grid/drawedges.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
ca96c02aee Alis*0001 function [] = drawedges(xg,yg,varargin)
0002 % Draws edges of cube on plot
0003 % >> drawedges(xg,yg)
f8d374081f Jean*0004 %
0005 % Written by adcroft@.mit.edu, 2001.
ca96c02aee Alis*0006 [nx ny nt]=size(xg);
0007 hnx=ceil(nx/2);
0008 hny=ceil(ny/2);
0009
0010 if ~isempty(varargin)
0011 col=varargin{1};
0012 else
0013 col='k';
0014 end
0015
0016 if ndims(xg)==2 & size(xg,1)==6*size(xg,2)
0017 [nx ny nt]=size(xg);
0018 x=permute( reshape(xg,[nx/6 6 ny]),[1 3 2]);
0019 y=permute( reshape(yg,[nx/6 6 ny]),[1 3 2]);
0020 [nx ny nt]=size(xg);
0021 elseif ndims(xg)==3 & size(xg,2)==6
0022 x=permute( X,[1 3 2]);
0023 y=permute( Y,[1 3 2]);
0024 [nx ny nt]=size(xg);
0025 elseif ndims(xg)==3 & size(xg,3)==6
0026 [nx ny nt]=size(xg);
0027 x=xg;y=yg;
0028 else
0029 size(xg)
0030 size(yg)
0031 error('Dimensions should be 2 or 3 dimensions: NxNx6, 6NxN or Nx6xN');
0032 end
0033
0034
0035 for sh=-180:90:180;
0036 for k=1:6;
0037 h=line( longitude(x(:,1,k))+sh, y(:,1,k));set(h,'Color',col);
0038 h=line( longitude(x(1,:,k))+sh, y(1,:,k));set(h,'Color',col);
0039 end
0040 end