clear; clc;

f = dir;
f = f(3 : end);
dir_idx = find([f.isdir]);
pooled_data = {};

for i = 1 : length(dir_idx)
    sub_folder = [pwd, '\', f(dir_idx(i)).name];
    cd(sub_folder);
    
    sub_folder_f = ls;
    for j = 3 : size(sub_folder_f, 1)
        fetch_data = importdata(sub_folder_f(j, :));
        pooled_data = [pooled_data; fetch_data];
    end
    cd('..');
end
pooled_data