title: MATLAB: how to read every Nth line of a text file?
body: <p>I have some data that's formatted as follows:</p>
  
  <pre><code>dtau     E_av        variance    N_sims      Time
  0.001   0.497951    0.000211625 25      Sun Apr  3 18:18:12 2011
  
  dtau     E_av        variance    N_sims      Time
  0.002   0.506784    0.000173414 25      Sun Apr  3 18:18:58 2011
  </code></pre>
  
  <p>Now I want to read the first 4 columns (anything but the time) of every third line into MATLAB using textscan; after using <code>fid = fopen('data.text')</code>, I basically have to loop this:</p>
  
  <pre><code>results = textscan(fid, '%f %f %f %f', 1,'headerlines',1);
  </code></pre>
  
  <p>Any ideas?
  Cheers!</p>