title: Building a Matlab table from a nested Matlab struct
body: <p>How would I build a table from the Matlab structure that the below code produces? </p>
  
  <pre><code>%create a nested structure
  a_1=struct('a',50,'b',60);
  a_2=struct('a',45','c',90);
  a_3=struct('c',105,'d',32);
  a=struct('Model1',a_1,'Model2',a_2,'Model3',a_3);
  </code></pre>
  
  <p>The desired output would look like the output from the below code:</p>
  
  <pre><code>%desired output 
  a=[50;45;0];
  b=[60;0;0];
  c=[0;90;105];
  d=[0;0;30];
  row_names={'Model1','Model2','Model3'};
  col_names={'a','b','c','d'};
  
  T=table(a,b,c,d,'RowNames',row_names)
  </code></pre>
  
  <p>Please note however that I had to fill the blanks with <code>0</code>s to write this code but it would be better to have something else there, such as <code>'-'</code> or <code>N/A</code>.  </p>