/[MITgcm]/MITgcm_contrib/grid_bathymetry_matlab/mypcolor.m
ViewVC logotype

Annotation of /MITgcm_contrib/grid_bathymetry_matlab/mypcolor.m

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


Revision 1.1 - (hide annotations) (download)
Tue Jun 27 15:35:11 2006 UTC (17 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: HEAD
Add matlab routines to generate gridded bathymetry file from
ETOPO2.raw.bin (courtesy D. Menemenlis)

1 heimbach 1.1 function h=mypcolor(x,y,z)
2     % mypcolor(x,y,z) simulate pcolor using image (much faster)
3    
4     if nargin == 1
5     h=image(x,'CDataMapping','scaled');
6     elseif nargin ==3
7     dx=diff(x);
8     dy=diff(y);
9     if min(dx)==max(dx) & min(dy)==max(dy)
10     h=image(x,y,z,'CDataMapping','scaled');
11     else
12     dx=min(x):min(abs(dx)):max(x);
13     dy=min(y):min(abs(dy)):max(y);
14     dz=interp2(x,y,z,dx,dy');
15     h=image(dx,dy,dz,'CDataMapping','scaled');
16     end
17     else
18     error('wrong number of arguments')
19     end
20     set(gca,'ydir','normal')

  ViewVC Help
Powered by ViewVC 1.1.22