VMEAN Mean over non-NaN elements along a specified dimension. Y=VMEAN(X,DIM) takes the mean of all non-NaN elements of X along dimension DIM. [Y,NUM]=VMEAN(X,DIM) also outputs the number of non-NaN data points NUM, which has the same dimension as X. [Y1,Y2,...YN]=VMEAN(X1,X2,...XN,DIM) or also works, where all the XN are the same size. VMEAN(X1,X2,...XN,DIM); with no output arguments overwrites the original input variables. __________________________________________________________________ Weighted means VMEAN can also form a weighted mean. Y=VMEAN(X,DIM,W) forms the weighted mean of X using weights W, an array of the same size as X. In this case [Y,NUM]=VMEAN(X,DIM,W) returns total weight used in forming the mean at each point, rather than the number of data points. Thus VMEAN(X,DIM,W) is the same as VMEAN(X.*W,DIM)./VMEAN(W,DIM). [Y1,Y2,...YN]=VMEAN(X1,X2,...XN,DIM,W) also works. __________________________________________________________________ This is part of JLAB --- type 'help jlab' for more information (C) 2001--2015 J.M. Lilly --- type 'help jlab_license' for details