title: Why the correlation between two vectors returns NAN in matlab?
body: <p>I want to calculate the correlation between each line of a matrix with the mean of its columns, for example:</p>
  
  <pre><code>a=[1,2,3;
     4,5,6];
  
  mean_column=[2.5;3.5,4.5];
  </code></pre>
  
  <p>but when I do the following it returns only NaNs.</p>
  
  <pre><code>corr(mean_column,a(1,:));
  ans =   NaN   NaN   NaN
          NaN   NaN   NaN
          NaN   NaN   NaN
  </code></pre>
  
  <p>I need to extract statistics from the vector of correlations, but these NaNs don't allow me to do that. What is happening? is there a correct way to replace these NaNs?</p>