write in a specific line of text file
9 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I'm writing a code and I would save the result in a specific line of text file. for example, the code should write the result on .txt file from line 6 or 7 but I don't know how can I do it. I've used
fid = fopen('z.txt', 'w');
fprintf(fid, '%d\r\n',MyResult);
fclose(fid)
But it can just write in a new line no each line as I want. Could you please help me
Hamed
4 件のコメント
Rik
2018 年 1 月 24 日
If you want to append lines, read the doc. If you want to do something else, you'll have to explain it more, preferably with some examples, because right now, I don't know if I understand you.
回答 (1 件)
Rik
2018 年 1 月 24 日
Use the append switch in fopen, fprinft an empty line, and fprintf the matrix with the FormatSpec of your choosing.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Low-Level File I/O についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!