title: Loop through files in a folder in matlab
body: <p>I have a set of days of log files that I need to parse and look at in matlab. </p>
  
  <p>The log files look like this:</p>
  
  <pre><code>LOG_20120509_120002_002.csv
  (year)(month)(day)_(hour)(minute)(second)_(log part number)
  </code></pre>
  
  <p>The logs increment hourly, but sometimes the seconds are one or two seconds off (per hour) which means i need to ignore what they say to do <code>loadcsv</code>.</p>
  
  <p>I also have another file:</p>
  
  <pre><code>LOG_DATA_20120509_120002.csv
  </code></pre>
  
  <p>which contains data for the whole hour (different data). </p>
  
  <p>The overall objective is to: </p>
  
  <pre><code> loop through each day 
       loop through each hour
           read in LOG_DATA for whole hour
           loop through each segment
               read in LOG for each segment
                   compile a table of all the data
  </code></pre>
  
  <p>I guess the question is then, how do i ignore the minutes of the day if they are different? I suspect it will be by looping through all the files in the folder, in which case how do i do that?</p>