Correlations of matrix I have a matrix of 10 column, each column has measurements at different times. I have a second matrix also of 10 columns, each consisting of measurements at different times.
I want to carry out cross correlations of every combination within this matrix. Example, xcorr row 1 matrix 1 with row 1 of matrix 2, then row 1 of matrix 1 of row 2 of matrix 2 and so on. I would like correlations and time lag for each and every combination of columns. 
I currently do this, but it means I have to do each row separately which is very time consuming.

[xc,lags] = xcorr(matrix1(:,1),matrix(:,2));
[~,I] = max(abs(xc));figure;
plot(lags,xc); 
legend(sprintf('Time delay %d',lags(I))); 
title('Column 1 matrix 1 xcorr with Column 2 matrix 2')
matrix1 = rand(10, 100);
matrix2 = rand(10, 100);
for ind1=1:size(matrix1, 2)
    for ind2=1:size(matrix2, 2)
        [xc{ind1, ind2},lags{ind1, ind2}] = xcorr(matrix1(:,1),matrix2(:,2));
        % Here you can add any other operation you want
    end
end