changeset 55:bf400bfe9a42

fixed bug when input contains nans and weights is a vector
author samer
date Tue, 17 Mar 2015 17:57:41 +0000
parents 9bcf5e133bf0
children a5b8bd686246
files general/arrutils/accumhist.m
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/general/arrutils/accumhist.m	Mon Feb 23 16:08:09 2015 +0000
+++ b/general/arrutils/accumhist.m	Tue Mar 17 17:57:41 2015 +0000
@@ -11,5 +11,6 @@
 % argument D can be a single element, eg [M], indicating that a vector
 % is desired. accumarry would require [M 1].
 
-H = accumarray(I(all(isfinite(I),2),:),W,tosize(D));
+K=all(isfinite(I),2);
+H = accumarray(I(K,:),W(K),tosize(D));