I have nearly a thousand .mat files with weird names:
My first problem is running a foor loop to open files that are named like this:
exp_trial1_0001
exp_trial1_0002
...
exp_trial1_1000
The fact that it's 4-digits makes it difficult for me. This won't work:
load(['exp_trial_', num2str(%04i), '.mat'])
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.
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.
Thank you very much!