title: MATLAB: Initialize and empty table with headers and concatenate it to another table
body: <p>I'm getting this error:</p>
  
  <blockquote>
    <p>Cannot concatenate the table variable 'epoch' because it is a cell
    in one table and a non-cell in another.</p>
  </blockquote>
  
  <p>To reproduce the error:</p>
  
  <pre><code>A.epoch = [1,2,3]';
  A.value = [10,20,30]';
  </code></pre>
  
  <p>Initialized empty table with headers:</p>
  
  <pre><code>Aclean = cell2table(cell(1,2), 'VariableNames', {'epoch', 'value'});
  </code></pre>
  
  <p>Vertically concatenate the 2 tables:</p>
  
  <pre><code>Aclean = vertcat(Aclean, struct2table(A));
  </code></pre>
  
  <p>What is the best way of concatenating tables with a for loop in Matlab?</p>