title: How can i list all the files in a folder with a specific name in matlab?
body: <p>I have been making a loop that assign Mx names for 121 different files in a folder.</p>
  
  <pre><code>    allFiles = dir( '*.xls''String' );
  allNames = { allFiles.name };
  
  for ii = 1:length(allNames) M(ii) = xlsread(allFiles(1i)); 
  end
  </code></pre>
  
  <p>Trouble is that there is no errormessage, but it isn't assigning any names for the values/files i want it to. </p>
  
  <pre><code>listing = dir('*.xls');
  
  disp(listing);
  </code></pre>
  
  <p>When i make a simple dir() it tells me </p>
  
  <pre><code> 121x1 struct array with fields:
      name
      date
      bytes
      isdir
      datenum
  </code></pre>
  
  <p>But i have to make it a String in order for xlsread() to work. </p>
  
  <p>What i want it to is to make a name for each file so i can handle them in matlab, (ie. addtion of two matrices).</p>
  
  <p>What can be wrong?</p>