# HG changeset patch # User Rik # Date 1270506446 25200 # Node ID acf2b099532dcb32d98b786011c10c00b19a9f6d # Parent 942386d6d1a5006807b30742550a07326eade2b0 Modify cut to behave equivalently to histc * statistics/cut.m: Criteria for data inside interval is now lower_edge <= data < higher_edge diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,12 @@ +2010-02-19 Rik + + * statistics/cut.m: Modify cut to use the same decision criteria as histc + when deciding whether a data point is inside or outside interval + +2010-04-02 Marc Vinyals + + * signal/arma_rnd.m: fix typo in test. + 2010-04-02 Marc Vinyals * signal/arma_rnd.m: fix typo in test. diff --git a/scripts/statistics/base/cut.m b/scripts/statistics/base/cut.m --- a/scripts/statistics/base/cut.m +++ b/scripts/statistics/base/cut.m @@ -53,12 +53,12 @@ error ("cut: BREAKS must be a scalar or vector"); endif - group = NaN * ones (size (X)); + group = NaN (size (X)); m = length (BREAKS); - if any (k = find ((X >= min (BREAKS)) & (X <= max (BREAKS)))) + if any (k = find ((X >= min (BREAKS)) & (X < max (BREAKS)))) n = length (k); group(k) = sum ((ones (m, 1) * reshape (X(k), 1, n)) - > (reshape (BREAKS, m, 1) * ones (1, n))); + >= (reshape (BREAKS, m, 1) * ones (1, n))); endif endfunction