# HG changeset patch # User Rik # Date 1406225517 25200 # Node ID ab5983dc058743b5380c7c03c8b75a0a81f3db3b # Parent bcbd309bf2724704c4078cce4a51c32dd93e9add statistics.m: Fix regression caused by change in skewness, kurtosis functions. * statistics.m: Call skewness and kurtosis functions with an empty matrix (use default) for the flag argument. Add %!test to check correct behavior. diff --git a/scripts/statistics/base/statistics.m b/scripts/statistics/base/statistics.m --- a/scripts/statistics/base/statistics.m +++ b/scripts/statistics/base/statistics.m @@ -61,7 +61,7 @@ emp_inv = quantile (x, [0.25; 0.5; 0.75], dim, 7); stats = cat (dim, min (x, [], dim), emp_inv, max (x, [], dim), mean (x, dim), - std (x, [], dim), skewness (x, dim), kurtosis (x, dim)); + std (x, [], dim), skewness (x, [], dim), kurtosis (x, [], dim)); endfunction @@ -77,6 +77,16 @@ %! assert (skewness (x), s(8,:), eps); %! assert (kurtosis (x), s(9,:), eps); +%! x = rand (7,5); +%! s = statistics (x, 2); +%! assert (min (x, [], 2), s(:,1), eps); +%! assert (median (x, 2), s(:,3), eps); +%! assert (max (x, [], 2), s(:,5), eps); +%! assert (mean (x, 2), s(:,6), eps); +%! assert (std (x, [], 2), s(:,7), eps); +%! assert (skewness (x, [], 2), s(:,8), eps); +%! assert (kurtosis (x, [], 2), s(:,9), eps); + %% Test input validation %!error statistics () %!error statistics (1, 2, 3)