# HG changeset patch # User John W. Eaton # Date 1293006047 18000 # Node ID 4c335d398c8d028076312880f269cd4a9553cd53 # Parent 277d891afae2c7b66fb4dd1120752fd000e73a6b skewness.m: make returned value have the same class as the input diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-12-22 John W. Eaton + + * statistics/base/skewness.m: Make returned value have the same + class as the input. + 2010-12-21 John W. Eaton * time/datevec.m: Style fixes. diff --git a/scripts/statistics/base/skewness.m b/scripts/statistics/base/skewness.m --- 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);