title: MATLAB - Need to split a Matrix into column variables with names sourced from another matrix?
body: <p>I am new to Matlab and I am having some trouble.</p>
  
  <p>I have two matrices that I obtained via importing data these are 'label' (a cell matrix of text) and 'data' (a matrix of doubles?). I need to be able to create variables relating to each column to allow them to be individually plotted and used in calculations. These variables should be automatically named using text from the label matrix. I can't use textread as these matices vary in size depending on source data</p>
  
  <p>Below is an example of my issue</p>
  
  <p>Data = </p>
  
  <pre><code>    1  2  3  4
  
      5  6  7  8
  
      9 10 11 12
  </code></pre>
  
  <p>label = A B C D </p>
  
  <p>I require some code to make Matlab automatically create variables as follows</p>
  
  <p>A =<br>
   1   </p>
  
  <p>5</p>
  
  <p>9 </p>
  
  <p>B =</p>
  
  <p>2</p>
  
  <p>6</p>
  
  <p>10</p>
  
  <p>etc.</p>
  
  <p>I tried using 'eval' to evaluate my label matrix and then '=' to assign the column, but I get an error message because my data matrix is a 'doubles' matrix not a 'cell' matrix.</p>
  
  <p>Thanks for any help you can offer</p>