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 diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -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
+++ b/scripts/statistics/base/skewness.m
@@ -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);