So, the answer is the same as originally given, then...use sotoo
fmto=['%12.3f' repmat('%12.3f',1,nCols-1)];
fido=fopen(youroutputfilename,'w');
fprintf(fido,'%s\n', yourheadertext)
for j=1:length(fileList)
fid = fopen(fileList(j).name,'r');
d=cell2mat(textscan(fid,'%f','headerlines', 6, 'treatasempty',{'n/a';'N/A'}));
fid=fclose(fid);
fprintf(fido,fmto,d')
end
fido=fclose(fido);
Adjust the various parameters to suit.
for more detail on the various options for empty values, and
for detail of format strings to match you desired output formats. With a regular file format it is really pretty straightforward. The other respondents use of save is somewhat less verbose at the cost of less control over the output format--your choice depending on wants/needs.
ERRATUM:
Forgot the \n character for the output format...
fmto=['%12.3f' repmat('%12.3f',1,nCols-1) '\n'];
Also if do want the tab-delimited form retained then need it as well...
fmto=['%12.3f' repmat('\t%12.3f',1,nCols-1) '\n'];
Best Answer