/[MITgcm]/MITgcm_contrib/gael/matlab_class/@gcmfaces/nanmean.m
ViewVC logotype

Annotation of /MITgcm_contrib/gael/matlab_class/@gcmfaces/nanmean.m

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


Revision 1.2 - (hide annotations) (download)
Thu Oct 20 20:57:01 2011 UTC (13 years, 8 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65r, checkpoint65p, checkpoint65q
Changes since 1.1: +4 -0 lines
- add help sections at the top.

1 gforget 1.1 function r = nanmean(p,varargin)
2 gforget 1.2 %overloaded gcmfaces nanmean function :
3     % 1) if single gcmfaces argument, then returns the global nanmean over all faces
4     % 2) if more than one argument, then simply calls double nanmean function for
5     % each face data, passing over the other arguments
6 gforget 1.1
7     if nargin==1;
8     tmp1=[];
9     for iFace=1:p.nFaces;
10     iF=num2str(iFace);
11     eval(['tmp1=[tmp1;p.f' iF '(:)];']);
12     end;
13     r=nanmean(tmp1);
14     return;
15     end;
16    
17     r=p;
18    
19     for iFace=1:r.nFaces;
20     iF=num2str(iFace);
21     eval(['r.f' iF '=nanmean(p.f' iF ',varargin{:});']);
22     end;
23    
24    

  ViewVC Help
Powered by ViewVC 1.1.22