title: cell to structures in matlab
body: <p>I've imported some .txt files into matlab using the textscan command, where I now have a variable 'C' which is an 8x4 cell, each column of the cell refers to different locations and each row refers to a different measured variable. So, I have 4 locations and 8 variables measured in each.</p>
  
  <p>How is it possible to convert C into a structure (i.e. 4 structures in this case) so that I have a structure for each location and within the structure I have variables defining each cell.</p>
  
  <p>I also have a variable called 'naming' which is also a 8x4 cell where each cell corresponds to the name of each of the different cells in C. So, each of these strings could be used when defining the arrays in the structure.</p>
  
  <p>How would I go about achieving this?
  I can do it manually by:</p>
  
  <pre><code>new1=struct(name{1,1},C{1,1}{1,1});
  </code></pre>
  
  <p>But this would be rather time consuming with large datasets.</p>