Home > custom > colfilt_filters > hypsom_mean.m

hypsom_mean

PURPOSE ^

PURPOSE: mean function to use with blkproc. Returns single mean value

SYNOPSIS ^

function [r] = hypsom_mean(X)

DESCRIPTION ^

 PURPOSE: mean function to use with blkproc. Returns single mean value
 of input matrix X

 See also: colfilt(), blkproc

 Felix Hebeler, Geography Dept., University Zurich, Jan 2007.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [r] = hypsom_mean(X)
0002 % PURPOSE: mean function to use with blkproc. Returns single mean value
0003 % of input matrix X
0004 %
0005 % See also: colfilt(), blkproc
0006 %
0007 % Felix Hebeler, Geography Dept., University Zurich, Jan 2007.
0008 
0009 %r=X(ceil(size(X,1)/2),:);
0010 n=sum(isnan(X(:)));
0011 if n>0
0012     if n>=numel(X)/2
0013         r=nan;
0014         return
0015     else
0016         X(isnan(X))=[];
0017     end
0018 end
0019 r=mean(X(:));
0020 
0021

Generated on Tue 24-Feb-2009 19:14:50 by m2html © 2003