title: How can I create 5-min time step file names in Matlab?
body: <p>I have start and end time</p>
  
  <pre><code>startTime = 12-Jun-2011 00:00:00
  endTime = 13-Jun-2011 1:45:00
  </code></pre>
  
  <p>And I want to create filenames every five minutes of this sort to store in an array:</p>
  
  <pre><code>RATE.20110612.000000.tif
  RATE.20110612.000500.tif
  RATE.20110612.001000.tif
  RATE.20110612.001500.tif
  .
  .
  .
  RATE.20110613.014000.tif
  RATE.20110613.014500.tif
  </code></pre>
  
  <p>So far I am doing this:</p>
  
  <pre><code>endTime = datenum('13-Jun-2011 1:45:00');
  startTime = datenum('12-Jun-2011 00:00:00');
  minSteps =int8(((endTime-startTime)*24*60)/5) %Number of 5 minute steps between start and end time
  
  for k = 1:minSteps
     FileNames{k} = strcat('RATE.',datestr(startTime, 'yyyymmdd.hhMMss'), '.tif');
     startTime = addtodate(startTime, 5, 'minute');
  end
  </code></pre>
  
  <p>But this doesn't work. How can I do it? The number of steps computation is also wrong.</p>