how to write text files in a specific format?
8 次查看(过去 30 天)
显示 更早的评论
Hello, Below is my code that would write data into a text file.
fileID = fopen('G:\FLOW_OUT_32.txt','w');
formatSpec = '%d %2.5f \n';
[nrows,ncols] = size(output32);
for row = 1:nrows
fprintf(fileID,formatSpec,output32{row,:});
end
fclose(fileID);
I would like the data to be written in the format shown below. Any help would be appreciated. Thanks
1
3 2.867000e-001
4 3.328000e-001
5 1.607000e-001
6 8.805000e-001
7 1.124000e+000
8 6.947000e-001
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!