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

Contents of /MITgcm_contrib/gael/matlab_class/@gcmfaces/prctile.m

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


Revision 1.1 - (show annotations) (download)
Sat Jan 18 21:12:36 2014 UTC (11 years, 6 months ago) by gforget
Branch: MAIN
- more overloaded functions.

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

  ViewVC Help
Powered by ViewVC 1.1.22