title: Downloading data from website
body: <p>I use the following code for downloading two files in a folder from a website. </p>
  
  <p>I want to download some files that contain "MOD09GA.A2008077.h22v05.005.2008080122814.hdf" and "MOD09GA.A2008077.h23v05.005.2008080122921.hdf" in the page. But I don't know how to select these files. The code below download all the files, but I only need two of them.</p>
  
  <p>Does anyone have any ideas? </p>
  
  <pre><code>URL = 'http://e4ftl01.cr.usgs.gov/MOLT/MOD09GA.005/2008.03.17/';
  % Local path on your machine
  localPath = 'E:/myfolder/';
  
  % Read html contents and parse file names with ending *.hdf
  urlContents = urlread(URL);
  ret = regexp(urlContents, '"\S+.hdf.xml"', 'match');
  
  
  % Loop over all files and download them
  for k=1:length(ret)
      filename = ret{k}(2:end-1);
      filepathOnline = strcat(URL, filename);
      filepathLocal = fullfile(localPath, filename);
      urlwrite(filepathOnline, filepathLocal);
  end
  </code></pre>