The function "mean" in 3.0.1:

Dave Goel deego3 at gmail.com
Fri Jul 10 16:59:20 CDT 2009


octave:127> version
ans = 3.0.1
octave:128> a=[1 2 3]
a =

   1   2   3

octave:129> b=mean(a,[])
b =

   1   2   3

The ansnwer should have been 2 per the documention, which says that
the dimension is by default taken to be the first dimension with >1
elements:

DIM     dimension
        1 MEAN of columns
        2 MEAN of rows
        N MEAN of  N-th dimension
        default or []: first DIMENSION, with more than 1 element



The function mean is found here for my octave:

`/usr/share/octave/packages/nan-1.0.6/mean.m'
which comes from the debian package octave-nan.




More information about the Bug-octave mailing list