changeset 10488:acf2b099532d

Modify cut to behave equivalently to histc * statistics/cut.m: Criteria for data inside interval is now lower_edge <= data < higher_edge
author Rik <code@nomad.inbox5.com>
date Mon, 05 Apr 2010 15:27:26 -0700
parents 942386d6d1a5
children d47802f0e557
files scripts/ChangeLog scripts/statistics/base/cut.m
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Apr 02 15:15:41 2010 -0400
+++ b/scripts/ChangeLog	Mon Apr 05 15:27:26 2010 -0700
@@ -1,3 +1,12 @@
+2010-02-19  Rik <octave@nomad.inbox5.com>
+
+	* 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  <mrc_timer@users.sourceforge.net>
+
+	* signal/arma_rnd.m: fix typo in test.
+
 2010-04-02  Marc Vinyals  <mrc_timer@users.sourceforge.net>
 
 	* signal/arma_rnd.m: fix typo in test.
--- a/scripts/statistics/base/cut.m	Fri Apr 02 15:15:41 2010 -0400
+++ b/scripts/statistics/base/cut.m	Mon Apr 05 15:27:26 2010 -0700
@@ -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