clear; clc;

file_list = dir(".");
filenames = string({file_list(:).name});
mask = contains(filenames, "market");
target_folders = filenames(mask);

tbl = cell(length(target_folders), 1);
for i = 1 : length(target_folders)
    curr_fold = target_folders(i);
    
    sub_file_list = dir(curr_fold);
    filenames = string({sub_file_list(:).name});
    mask = endsWith(filenames, "xlsx");
    
    target_files = filenames(mask);
    for j = 1 : length(target_files)
        curr_filename = target_files(j);
        [~, ~, raw] = xlsread(curr_fold + "/" + curr_filename); 
        tbl{i} = raw;
    end
end

save("data.mat", "tbl");