I have a folder with subfolders containing multiple mat files that have a smiliar name pattern.
I would like to access each subfolder and collate two mat files that have similar name pattern. For example two files indicated red above both end in 'T001'. I would like to collate those two and save it as a separte file . Similalry, I would like to do the same for each pair of mat files that have similar name pattern ending . Number of mat files in each subfolder is the same and endings are the same. Can you help please?
I can list files and load them in a loop but not sure how to progress
subfolder1 = 'C:\Users\whctc4\Desktop\Data\EWWD_ID001\Processed data\Xsens Awinda MTw';
subfolder2 = 'C:\Users\whctc4\Desktop\Data\EWWD_ID001\Processed data\Xsens Dot';
all_Mt2files = dir(fullfile(subfolder1, '*.mat'));
all_Dotfiles = dir(fullfile(subfolder2, '*.mat'));
for k = 1:length(all_Mt2files)
F = fullfile(subfolder1,all_Mt2files(k).name);
for k = 1:length(all_Dotfiles)
J = fullfile(subfolder2,all_Dotfiles(k).name);