0001 function pslice(x,y,u,cax,label)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 ind=find(~isnan(u));
0018 if(nargin<4),
0019 cax(1)=min(u(ind));
0020 cax(2)=max(u(ind));
0021 end
0022 u(ind)=max(u(ind),cax(1));
0023 u(ind)=min(u(ind),cax(2));
0024 [m,n]=size(x);
0025 if(min(m,n)>1),
0026 x=.25*(x(1:m-1,1:n-1)+x(2:m,1:n-1)+x(1:m-1,2:n)+x(2:m,2:n));
0027 y=.25*(y(1:m-1,1:n-1)+y(2:m,1:n-1)+y(1:m-1,2:n)+y(2:m,2:n));
0028 u(1,:)=[];
0029 u(:,1)=[];
0030 end
0031 if(exist('label')==1),
0032 clegend4(cax',label);pcolor(x,y,u);colormap('jet');...
0033 else
0034 clegend4(cax');pcolor(x,y,u);colormap('jet');...
0035 end
0036 shading('flat');caxis(cax);
0037 matlab_version = version;
0038 if ( matlab_version(1) == '5' )
0039 set ( gca, 'DataAspectRatio', [1 1 1] );
0040 else
0041 set(gca,'aspectratio',[NaN 1])
0042 end