If my reading of the xcorr doc is correct (I don't have the signal processing toolbox), you could just apply xcorr to the whole matrix (transposed as xcorr works columnwise) and then discard the columns that are to cross-correlations with other columns:
allcorrelations = xcorr(A');
ncols = size(A, 1);
autocorrelations = allcorrelations(:, sub2ind([ncols ncols], 1:ncols, 1:ncols))';
Alternatively:
autocorrelations = cellfun(@xcorr, num2cell(A, 2), 'UniformOutput', false);
autocorrelations = vertcat(autocorrelations{:});
The second option is possibly slower than the first since it is basically loops over each row. On the other hand it doesn't waste time calculating the cross-correlations. It is certainly going to be more memory efficient.
Best Answer