title: Read and reshape many matrices from many large .mat files efficiently
body: <p>I have nearly a thousand .mat files with weird names:</p>
  
  <p>My first problem is running a foor loop to open files that are named like this:</p>
  
  <pre><code>exp_trial1_0001
  exp_trial1_0002
  ...
  exp_trial1_1000
  </code></pre>
  
  <p>The fact that it's 4-digits makes it difficult for me. This won't work:</p>
  
  <pre><code>load(['exp_trial_', num2str(%04i), '.mat'])
  </code></pre>
  
  <p>There are 1000 .mat files corresponding to 1000 trials. In each one of these .mat files there's a matrix A. Matrix A has 500 rows. I want to take out all the row 1s (and 2s, 3s, ... 500) for each .mat file ("trial") and put them in a separate matrix. </p>
  
  <p>I cannot load all these .mat files simultaneously and then do this because I run out of memory. I'd like to know what the most efficient way to do this is.</p>
  
  <p>Thank you very much!</p>