title: Formatting data from an excel sheet (two criteria) in MATLAB
body: <p>I have a question related to <a href="https://stackoverflow.com/questions/47209419/formatting-data-from-an-excel-sheet-in-matlab">another one</a> recently asked. I download my data as a <code>csv.file</code>. I then format it in MATLAB. I obtan formatted data such as:</p>
  
  <p><a href="https://i.stack.imgur.com/sGDJy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sGDJy.png" alt="enter image description here"></a></p>
  
  <p>I would like to format the data so that I obtain:</p>
  
  <p><a href="https://i.stack.imgur.com/57NAD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/57NAD.png" alt="enter image description here"></a></p>
  
  <p>In other words, the date should be in the first column, while the two identifier should be in the first two rows, respectively.</p>
  
  <p>I tried the code provided by @gnovice, yet I have problems to adjust for the second identifier. The code is:</p>
  
  <pre><code>A = accumarray([rowIndex colIndex], data(:, 4), [], @(x) x(1));
  A = [NaN colVals; rowVals A];
  </code></pre>
  
  <p>where <code>data</code> is equal to picture (1).</p>
  
  <p>Therefore, I obtain a matrix <code>A</code> like:</p>
  
  <pre><code> A = 
        NaN     1    2     3;
   20160101   100   80    90;
   20170101   150   90   200;
  </code></pre>
  
  <p>How can I adjust my code in a way that the second identifier is taken care of and <code>A</code> becomes:</p>
  
  <pre><code> A = 
        NaN     1    2     3;
        NaN    10   10    15;
   20160101   100   80    90;
   20170101   150   90   200;
  </code></pre>