title: How do I get rid of NaNs in MATLAB?
body: <p>I have files which have many empty cells which appear as NaNs when I use <code>cell2mat</code>, but the problem is when I need to get the average values I cannot work with this as it shows error with NaN. In excel it overlooks NaN values, so how do I do the same in MATLAB?</p>
  
  <p>In addition, I am writing a file using <code>xlswrite</code>:</p>
  
  <pre><code>xlswrite('test.xls',M);
  </code></pre>
  
  <p>I have data in all rows except 1. How do I write:</p>
  
  <pre><code>M(1,:) = ('time', 'count', 'length', 'width')
  </code></pre>
  
  <p>In other words, I want <code>M(1,1)='time'</code>, <code>M(1,2)='count'</code>, and so on. I have data from <code>M(2,1)</code> to <code>M(10,20)</code>. How can I do this?</p>