/[MITgcm]/MITgcm/utils/matlab/drawedges.m
ViewVC logotype

Contents of /MITgcm/utils/matlab/drawedges.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Thu Sep 15 20:07:45 2005 UTC (17 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
FILE REMOVED
moved from utils/matlab to utils/matlab/cs_grid.

1 function [] = drawedges(xg,yg,varargin)
2 % Draws edges of cube on plot
3 % >> drawedges(xg,yg)
4
5 [nx ny nt]=size(xg);
6 hnx=ceil(nx/2);
7 hny=ceil(ny/2);
8
9 if ~isempty(varargin)
10 col=varargin{1};
11 else
12 col='k';
13 end
14
15 if ndims(xg)==2 & size(xg,1)==6*size(xg,2)
16 [nx ny nt]=size(xg);
17 x=permute( reshape(xg,[nx/6 6 ny]),[1 3 2]);
18 y=permute( reshape(yg,[nx/6 6 ny]),[1 3 2]);
19 [nx ny nt]=size(xg);
20 elseif ndims(xg)==3 & size(xg,2)==6
21 x=permute( X,[1 3 2]);
22 y=permute( Y,[1 3 2]);
23 [nx ny nt]=size(xg);
24 elseif ndims(xg)==3 & size(xg,3)==6
25 [nx ny nt]=size(xg);
26 x=xg;y=yg;
27 else
28 size(xg)
29 size(yg)
30 error('Dimensions should be 2 or 3 dimensions: NxNx6, 6NxN or Nx6xN');
31 end
32
33
34 for sh=-180:90:180;
35 for k=1:6;
36 h=line( longitude(x(:,1,k))+sh, y(:,1,k));set(h,'Color',col);
37 h=line( longitude(x(1,:,k))+sh, y(1,:,k));set(h,'Color',col);
38 end
39 end

  ViewVC Help
Powered by ViewVC 1.1.22