filename = 'test2.txt';
fid = fopen(filename,'w');
fprintf(fid, 'HEADER \n');
fclose(fid);
for k = 1:1:5
UFF = X_filter(1:ni*nk,k);
VFF = X_filter(1+ni*nk:2*ni*nk,k);
UFF1 =reshape (UFF,ni,nk)';
VFF1 =reshape (VFF,ni,nk)';
UUFFF1 = reshape (UFF1, 4650,1);
VVFFF1 = reshape (VFF1,4650,1);
xxx = reshape (X,4650,1);
yyy = reshape (Y,4650,1);
fileName = sprintf('test%d.txt',k);
dlmwrite(fileName,[xxx yyy UUFFF1 VVFFF1],'delimiter','\t','-append');
end
2 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/581777-insertion-of-header-in-the-first-row-of-txt-file#comment_978827
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/581777-insertion-of-header-in-the-first-row-of-txt-file#comment_978827
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/581777-insertion-of-header-in-the-first-row-of-txt-file#comment_978842
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/581777-insertion-of-header-in-the-first-row-of-txt-file#comment_978842
Sign in to comment.