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

조회 수: 2 (최근 30일)
Ga Ma
Ga Ma 2020년 4월 8일
댓글: Ga Ma 2020년 4월 8일
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