title: How do I detect empty cells in a cell array?
body: <p>How do I detect empty cells in a cell array? I know the command to remove the empty cell is <code>a(1) = []</code>, but I can't seem to get MATLAB to automatically detect which cells are empty. </p>
  
  <p>Background: 
  I preallocated a cell array using <code>a=cell(1,53)</code>. 
  Then I used <code>if exist(filename(i))</code> and textscan to check for a file, and read it in. As a result, when the <code>filename(i)</code> does not exist, an empty cell results and we move onto the next file. </p>
  
  <p>When I'm finished reading in all the files, I would like to delete the empty cells of <code>a</code>. I tried <code>if a(i)==[]</code></p>