title: read all files from specific folder in matlab?
body: <p>I want to read .PGM files from specific folder.</p>
  
  <p>Here is my specific folder that keep all the .pgm files</p>
  
  <pre><code>  a = 'D:\Matlab\Training\Training_PGM_All\';
  </code></pre>
  
  <p>And I try to read all the files inside that folder</p>
  
  <pre><code>        tmpdir =  dir([a, '*']);
  </code></pre>
  
  <p>I still cannot read all those files.  I dont want to specific the path directly in the code. So I want to keep the directory in a variable  and then I'll call that variable in the code.</p>
  
  <p>What's wrong with that code..</p>