Hi Steven,
Thank you. I agree and trust me I did not care or know about it. I have a support ticket open and it might come to you as well from your team where it seems like multiple CPU machines take 4-5x longer to do accumarray than a single CPU machine. It could be just a problem in our machines, Richa Gupta is investigating this. The code I am running is pasted below, a sample test code. I am doing accumarray on matrices of 1e4 x 1e4 or some times even bigger. I have to do this on thousands of data sets and it takes 5-10 sec to do each of this. I was thinking or hoping that it would do in 1 sec as it is a vectorized operation. I am open to any new way of doing this.
Suresh
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
C=rand(1e4,1e4);
tic;
dim=size(C,1);
[z1,z2]=meshgrid(1:dim,1:dim);
h=z1-z2;
h=triu(h); %upper and lower triangular are symmetrical, so get rid of one
g=(h~=0);
C=C.*g;%get rid of the lower triangle in the two time
hh=h(g); %get the pixel indices with non-zero t1-t2
CC=C(g); %get the corr. values with non-zero t1-t2
g2full=accumarray(hh(:),CC(:)); %sums up values of C that belong to the same pixel indices as hh
index_count=histc(h(:),min(hh):max(hh)); %count the number of pixels in each parallel to diagonal
g2full=g2full./index_count;
toc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
"Steven Lord" <
Steve...@mathworks.com> wrote in message <msccs5$6m8$
1...@newscl01ah.mathworks.com>...