title: How to get filename structure in a folder in Matlab
body: <p>I am designing a GUI in Matlab,</p>
  
  <p>I have a folder called <code>sth</code>. It contains many files having same structure like, </p>
  
  <pre><code>filename_1_something.mat
  filename_2_something.mat
  </code></pre>
  
  <p>In order to loop over filenames by selecting via index, I need to find a resulting string like this;</p>
  
  <pre><code>filename_%d_something.mat
  </code></pre>
  
  <p>So I don't need to read all the files in the dir. Two of the filenames are enough to compare strings and find the different char array item and change by <code>%d</code>. </p>
  
  <p>Or anything different than this also appreciated.</p>