/[MITgcm]/MITgcm/verification/tutorial_global_oce_latlon/diags_matlab/sq.m
ViewVC logotype

Annotation of /MITgcm/verification/tutorial_global_oce_latlon/diags_matlab/sq.m

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


Revision 1.1 - (hide annotations) (download)
Sat Aug 12 19:37:26 2006 UTC (17 years, 9 months ago) by jmc
Branch: MAIN
moved from verification/global_ocean.90x40x15/diags_matlab ;
 add Header and Name; use "quiver" instead of NaNquiver (<- not standard);

1 jmc 1.1 % sq(A) is similar to squeeze(A) except that elements =0 are set to NaN
2     %
3     % sq(A) 0 -> NaN
4     % sq(A,val1) val1 -> NaN
5     % sq(A,val1,val2) val1 -> val2
6    
7     % $Header: $
8     % $Name: $
9    
10     function [A] = sq(B,varargin);
11     A=squeeze(B);
12     if nargin>=2
13     nodata=varargin{1};
14     else
15     nodata=0;
16     end
17     if nargin==3
18     newval=varargin{2};
19     else
20     newval=NaN;
21     end
22     %A(find(A==nodata))=A(find(A==nodata))*NaN;
23     A(find(A==nodata))=newval;

  ViewVC Help
Powered by ViewVC 1.1.22