Sun 04 Sep 2011 05:03:00 PM UTC, original submission:
I don't know if this is the right place to be submitting this but it seems to be in the source forge bugs page.
I have installed the statistics package from source forge version 1.0.10. I tried to use the geommean function and it came up with the following error:
>>> c = [1 1 3 6 9]
c =
1 1 3 6 9
>>> harmmean(c)
error: `s' undefined near line 28 column 14
>>>error: evaluating argument list element number 1
error: called from:
error: /home/malapradej/octave/statistics-1.0.10/harmmean.m at line 28, colum
n 7
I corrected this in my geommean.m file to the following:
## Copyright (C) 2001 Paul Kienzle
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; If not, see <http://www.gnu.org/licenses/>.
## -- texinfo --
## @deftypefn {Function File} harmmean (@var{x})
## @deftypefnx{Function File} harmmean (@var{x}, @var{dim})
## Compute the harmonic mean.
##
## This function does the same as @code{mean (x, "h")}.
##
## @seealso{mean}
## @end deftypefn
function a = harmmean(x, dim)
if (nargin == 1)
a = mean(x, "h");
else
a = mean(x, "h", dim);
endif
endfunction
It was line 28 which was
a = mean(s, "h");
Hope this can be included in the next update.
Cheers,
Jacques
|