# HG changeset patch # User jwe # Date 1102048331 0 # Node ID c42c90543e363656943986d78cc7da63a32d6c6d # Parent 3db2b2762491494e3afc60b2fc19fde8b116fd80 [project @ 2004-12-03 04:32:11 by jwe] diff -r 3db2b2762491 -r c42c90543e36 scripts/ChangeLog --- a/scripts/ChangeLog Fri Dec 03 04:06:05 2004 +0000 +++ b/scripts/ChangeLog Fri Dec 03 04:32:11 2004 +0000 @@ -1,3 +1,7 @@ +2004-12-02 Balint Reczey + + * statistics/base/moment.m: Fix argument parsing for N-d arrays. + 2004-11-09 John W. Eaton * miscellaneous/fileparts.m: Allow filenames with no extension. diff -r 3db2b2762491 -r c42c90543e36 scripts/statistics/base/moment.m --- a/scripts/statistics/base/moment.m Fri Dec 03 04:06:05 2004 +0000 +++ b/scripts/statistics/base/moment.m Fri Dec 03 04:32:11 2004 +0000 @@ -53,10 +53,10 @@ need_dim = 0; - if (nargin == 1) + if (nargin == 2) opt = ""; need_dim = 1; - elseif (nargin == 2) + elseif (nargin == 3) if (isstr (opt1)) opt = opt1; need_dim = 1; @@ -64,7 +64,7 @@ dim = opt1; opt = ""; endif - elseif (nargin == 3) + elseif (nargin == 4) if (isstr (opt1)) opt = opt1; dim = opt2; @@ -78,9 +78,6 @@ usage ("moment (x, p, dim, opt) or moment (x, p, dim, opt)"); endif - sz = size(x); - n = sz (dim); - if (need_dim) t = find (size (x) != 1); if (isempty (t)) @@ -93,7 +90,7 @@ sz = size (x); n = sz (dim); - if (numels (x) < 1) + if (numel (x) < 1) error ("moment: x must not be empty"); endif