title: Correlation coefficient between rows of two matrices
body: <p>I have the following code, how will I be able to simplify it using the function as it currently runs pretty slow, assume <code>X</code> is 10x7 and <code>Y</code> is 4x7 and <code>D</code> is a matrix stores the correlation between each pair of vectors. If the solution is to use the <code>xcorr2</code> function can someone show me how it is done?</p>
  
  <pre><code>for i = 1:4
      for j = 1:10
          D(j,i) = corr2(X(j,:),Y(i,:));
      end
  end
  </code></pre>