# HG changeset patch # User Nicholas R. Jankowski # Date 1669231920 18000 # Node ID 7b6d4b6afef21713f2aecd1753a71b2ffe6f0c25 # Parent 8027b17bcb9205ffbb517b15b88081c973bbc5e5# Parent 24ca5cb70a4a5422ced0f155a41b9c2f61128dff maint: Merge stable to default. diff -r 8027b17bcb92 -r 7b6d4b6afef2 etc/NEWS.8.md --- a/etc/NEWS.8.md Wed Nov 23 08:59:59 2022 -0500 +++ b/etc/NEWS.8.md Wed Nov 23 14:32:00 2022 -0500 @@ -181,7 +181,7 @@ - Improved input validation and/or output handling for `poly`, `pinv`, `patch`, `fill`, `fill3`, `qp`, `datevec`, `textscan`, `sub2ind`, `qr`, `airy`, - `regexp`, `dec2bin`, `dec2hex`, and many others. + `regexp`, `dec2bin`, `dec2hex`, `mean`, and many others. - Improved performance for `complex`, `fftw`, `delaunayn`, `isfield`, `tsearch`, sparse matrix exponentiation, other sparse operations, and many others. - Overhauled `@audiorecorder` and `@audioplayer` classes. diff -r 8027b17bcb92 -r 7b6d4b6afef2 scripts/statistics/mean.m --- a/scripts/statistics/mean.m Wed Nov 23 08:59:59 2022 -0500 +++ b/scripts/statistics/mean.m Wed Nov 23 14:32:00 2022 -0500 @@ -157,7 +157,7 @@ ## Two numeric input arguments, dimensions given. Note scalar is vector! dim = varargin{1}; - if (! (isvector (dim) && all (dim)) || any (rem (dim, 1))) + if (! (isvector (dim) && dim > 0 && rem (dim, 1) == 0)) error ("mean: DIM must be a positive integer scalar or vector"); endif @@ -347,7 +347,11 @@ %!error mean ("char") %!error mean (1, ones (2,2)) %!error mean (1, 1.5) +%!error mean (1, -1) +%!error mean (1, -1.5) %!error mean (1, 0) +%!error mean (1, NaN) +%!error mean (1, Inf) %!error %! mean (repmat ([1:20;6:25], [5 2 6 3 5]), [1 2])