Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Writting to .txt file doesn't keep the file structure

2 ビュー (過去 30 日間)
Frederico
Frederico 2014 年 5 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Good morning, I am trying to write a complete text to a .txt file. This is the code I am using:
C = {'Atkins is the best at 1';'Cheng sucks at 3'}; fileID = fopen('fullname.txt','w'); formatSpec = '%s'; [nrows,ncols] = size(C); for row = 1:nrows fprintf(fileID,formatSpec,C{row,:}); end fclose(fileID);
Although the file C appears with two lines, when I open the .txt it is all in one line. The aim is to write a .txt file with more or less 30 lines that will be used by another software. Thanks in advance for any help

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by