How to add data to an existing txt file which already contains some lines ?

조회 수: 34 (최근 30일)
How to add data to an existing txt file which already contains some lines ?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 8월 6일
a=[1 2 3;4 5 6]
dlmwrite('file.txt',a,'-append','newline','pc')

추가 답변 (1개)

Stephen23
Stephen23 2015년 8월 6일
편집: Stephen23 2015년 8월 6일
Read the fopen documentation and have a look at the permission options. You will find the permission 'a' or 'a+' of particular interest.
You can use fprintf to print text to file, or one of the other text-file writing functions.

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by