Mercurial > octave-nkf
changeset 11401:4c335d398c8d
skewness.m: make returned value have the same class as the input
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Dec 2010 03:20:47 -0500 |
parents | 277d891afae2 |
children | a9a3ee461b83 |
files | scripts/ChangeLog scripts/statistics/base/skewness.m |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog Tue Dec 21 14:59:04 2010 -0500 +++ b/scripts/ChangeLog Wed Dec 22 03:20:47 2010 -0500 @@ -1,3 +1,8 @@ +2010-12-22 John W. Eaton <jwe@octave.org> + + * statistics/base/skewness.m: Make returned value have the same + class as the input. + 2010-12-21 John W. Eaton <jwe@octave.org> * time/datevec.m: Style fixes.
--- a/scripts/statistics/base/skewness.m Tue Dec 21 14:59:04 2010 -0500 +++ b/scripts/statistics/base/skewness.m Wed Dec 22 03:20:47 2010 -0500 @@ -74,7 +74,7 @@ idx (dim) = c; x = x - repmat (mean (x, dim), idx); sz(dim) = 1; - retval = zeros (sz); + retval = zeros (sz, class (x)); s = std (x, [], dim); ind = find (s > 0); x = sum (x .^ 3, dim);