title: Elegant way to get the number of .mat files in a directory
body: <p>Assuming I have X  <code>.mat</code>files under a directory called <code>my_experiment_1/data</code>, I know I can load them into</p>
  
  <pre><code>experiment1_files = dir(['my_experiments/data/*.mat']);
  </code></pre>
  
  <p>Now I would like to open them in a <code>for</code> loop with the <code>.name</code> extension of <code>dir</code>:</p>
  
  <pre><code>for count = 1:N
    % load data-set
    load(experiment1_files(count).name);
    ...
  end
  </code></pre>
  
  <p>and perform a bunch of operations with the matrices of each file.</p>
  
  <p><strong>Question</strong>: what is the way to compute the number of files withing a directory in MATLAB (meaning, the number <code>N</code> in the <code>for</code>-loop above)?</p>