title: Running a function on several files in Matlab
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6550576/how-to-run-the-same-code-with-many-filesdifferent-file-name-in-same-directory">how to run the same code with many files(different file name in same directory) in matlab?</a>  </p>
  </blockquote>
  
  
  
  <p>I have written a function with definition:</p>
  
  <pre><code>function deleteEmpty(fileName)
  </code></pre>
  
  <p>Normally when I want to execute the function, in the command window I type:</p>
  
  <blockquote>
  <pre><code>&gt;&gt; deleteEmpty('C:\Documents and Settings\matlab\**myFile**.xls')
  </code></pre>
  </blockquote>
  
  <p>However, I have many files that need to be run through this function.  Does that mean I need to copy and paste the filename and execute the function each time?</p>
  
  <p>Is there any faster way or code to process all my files?</p>