changeset 56:a5b8bd686246

Fixed horrible bug.
author samer
date Thu, 19 Mar 2015 22:47:50 +0000
parents bf400bfe9a42
children ce9021da6ce2
files general/arrutils/accumhist.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/general/arrutils/accumhist.m	Tue Mar 17 17:57:41 2015 +0000
+++ b/general/arrutils/accumhist.m	Thu Mar 19 22:47:50 2015 +0000
@@ -12,5 +12,6 @@
 % is desired. accumarry would require [M 1].
 
 K=all(isfinite(I),2);
-H = accumarray(I(K,:),W(K),tosize(D));
+if ~isscalar(W), W=W(K); end
+H = accumarray(I(K,:),W,tosize(D));