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

32 次查看(过去 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.

标签

Community Treasure Hunt

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

Start Hunting!

Translated by