# HG changeset patch # User samer # Date 1426805270 0 # Node ID a5b8bd686246461c78a1291930d2fe541b1f8bd6 # Parent bf400bfe9a42ba928af369afc569592ea08b450d Fixed horrible bug. diff -r bf400bfe9a42 -r a5b8bd686246 general/arrutils/accumhist.m --- 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));