fileDir = pwd; % current directory (or specify which one is the working directory)
S = dir(fullfile(fileDir,'*.csv')); % get list of data files in directory
S = natsortfiles(S); % sort file names into natural order , see : https://fr.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort
for k = 1:length(S)
filename = S(k).name % to actually show filenames are sorted (see command window)
T = readtable(fullfile(fileDir, filename),'VariableNamingRule','preserve');
S(k).data = T; % store each table in an element of the S struct array
end
T = vertcat(S.data) % combine all the tables
% plot all the data
x = T.Date + T.Time; % Combining date and time
y = T.FIT; % Pressure data
plot(x,y);
% save new file
writetable(T, 'new_file.csv');