meannz.mBack to Contents<< Prev |  Next >> 

meannz
Mean value of nonzero elements.

Description
For vectors, meannz(X) is the mean value of the nonzero elements in X. 
For matrices, meannz(X) is a row vector containing the mean value of 
each column.  For N-D arrays, meannz(X) is the mean value of the 
nonzero elements along the first non-singleton dimension of X. 
 
meannz(X,DIM) takes the mean along the dimension DIM of X. 
 
meannz works like Matlab's MEAN, except that the sums are normalized 
with the number of non zero elements instead of the number of elements. 
 
Example: If X = [0 1 2 
                 3 4 5] 
 
then meannz(X,1) is [3 2.5 3.5] and meannz(X,2) is [1.5 
                                                    4  ] 
 
F. Moisy 
Revision: 1.00,  Date: 2005/10/21. 
 
See Also
spaverf, MEAN. 

 Previous: loadvecNext: mstime 

Help file generated by m2html 1.06