Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 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