How to create a .txt file in matlab to report mt output

1 次查看(过去 30 天)
Now, I have 5 outputs and i want to create a .txt file to report my outputs. The content should be these 5 sentences. How can i do that?

采纳的回答

Geoff Hayes
Geoff Hayes 2020-4-8
From fprintf, use fopen to create (or open) a file and write to it as
fid = fopen('myDataFile.txt', 'w+');
fprintf(fid, 'The price of N a is %f\n', A);
% etc.
fclose(fid);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Standard File Formats 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by