title: Reading formatted text from a file
body: <p>I'm tring to read the follwing text file with Matlab:</p>
  
  <pre><code>00000008.jpg 1 2 1
  00000001.jpg 1 2 1
  00000054.jpg 1 2 1
  </code></pre>
  
  <p>What I want to extract is each column of each line in order to access it.</p>
  
  <p>I've tried the following code:</p>
  
  <pre><code>fileLabels = fopen('file.txt');
  C = textscan(fileLabels,'%s %n %n %n');
  celldisp(C)
  </code></pre>
  
  <p>And it returns:</p>
  
  <pre><code>C{1}{1} =
  00000008.jpg
  
  C{1}{2} = 
  00000001.jpg
  
  C{1}{3} =
  00000054.jpg
  </code></pre>
  
  <p>Which is good, because this way I have the first string separated in cells, but, when I try to get the numbers, they appear this way:</p>
  
  <pre><code>C{2} =
       1
       1
       1
  
  C{3} =
       2
       2
       2
  
  C{4} =
       1
       1
       1
  </code></pre>
  
  <p>Instead of having them separated in cells, they appear all in one cell. If I try to access to one cell of the 2º column, it appears the following error:</p>
  
  <pre><code>&gt;&gt; C{2}{1}
  Cell contents reference from a non-cell array object.
  </code></pre>
  
  <p>Please, anyone knows how to extract each column separately line by line?</p>