"I would like to create one merged file after each Iteration"
If by "merged file" you mean a file containing the contents of all the files read so far, one way to do that is: instead of storing the files' contents in a cell array whose cells' contents will be vertcat-ed at the end, do the vertcat-ing as you go.
D = 'absolute/relative path to where the files are saved';
N = 25; % number of files
M = [];
for k = 1:N
F = fullfile(D,sprintf('m%d.txt',k));
M = [M; readmatrix(F)]; % readmatrix is recommended over dlmread
writematrix(M,sprintf('m%d0.txt',k),'Delimiter','\t'); % writematrix is recommmended over dlmwrite
end
Note that the files created by this code go into the current directory, not D. If you want them to go into D, then use fullfile to construct the output file names, e.g.:
for k = 1:N
% ...
writematrix(M,fullfile(D,sprintf('m%d0.txt',k)),'Delimiter','\t');
end