changeset 5901:5610a3fdeca6

[project @ 2006-07-22 08:40:40 by jwe]
author jwe
date Sat, 22 Jul 2006 08:40:40 +0000
parents c20eb7330d13
children 6af4cea82cc7
files scripts/ChangeLog scripts/special-matrix/hadamard.m
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,7 @@
+2006-07-22  John W. Eaton  <jwe@octave.org>
+
+	* special-matrix/hadamard.m: Coerce bool matrix to double.
+
 2006-07-07  John W. Eaton  <jwe@octave.org>
 
 	* miscellaneous/orderfields.m: New file.
--- a/scripts/special-matrix/hadamard.m
+++ b/scripts/special-matrix/hadamard.m
@@ -161,7 +161,10 @@
        '--++-++++-+-+----+++-----+--';
        '+--++-+-++-+-+----+++-----+-';
        '++--++-+-++-+-+----++------+'];
-  h = (s=='+');
+  ## Without this, the assignment of -1 will not work properly
+  ## (compatibility forces LHS(idx) = ANY_VAL to keep the LHS logical
+  ## instead of widening to a type that can represent ANY_VAL).
+  h = double (s=='+');
   h(!h) = -1;
 endfunction