title: Creating dataset from matrix in Matlab
body: <p>I'm trying to create a dataset from a double matrix and cell array of labels. </p>
  
  <p>I don't have access to the mat2dataset function so I'm trying to write something similar.</p>
  
  <pre><code>&gt;&gt; whos data feature_labels
    Name                Size             Bytes  Class     Attributes
    data                2x208             3328  double              
    feature_labels      1x208            50776  cell   
  </code></pre>
  
  <p>In actual use the data will have ~2million rows and always be double format. The number of columns will range from 20 up to 2000, so doing something like;</p>
  
  <pre><code>&gt;&gt; D = dataset([],[],[],[],[],...[], 'VarNames', feature_labels); 
  </code></pre>
  
  <p>isn't really feasible. </p>
  
  <p>Any suggestions?</p>
  
  <p>edit: </p>
  
  <p>Currently using a for loop and horzcat to concatenate new dataset columns on each loop. I don't see a way to pre-allocate the dataset size is this way so I imagine performance will chug with the larger datasets though.. </p>