Now that my conbinations indexing problem is solved, (thanks again Mr Fig), I would like to speed up computation time.
The problem is:
Currently I use the xcorr2 function on a pair of 64x128-cell matrices. Unfortunately, I am using it on 10s of thousands of 64x128-cell matrices. I KNOW that the lags outside of 'close' to zero (say 10x10) are the only ones I am interested in. There are a LOT of wasted FLOPS spent on calculating the whole 127x255 correlation matrix.
The question is:
Is there a way to index the xcorr2 command to minimize the FLOPS required to get the information I am after? Restated another way: Can I specify a range of lags for xcorr2?
I understand that in the alternative, I could rewrite the xcorr2 function, but I hate to reinvent the wheel.