Saving variable in txt file
조회 수: 20 (최근 30일)
이전 댓글 표시
I wan to save my variable in a text file with save('Final.txt','acc','-ASCII'); but i want to first go over some line(pass a few line unchanged)and then save the acc variable in that text file .
댓글 수: 0
답변 (2개)
Image Analyst
2014년 2월 8일
Use fopen(), fprintf(), and fclose() and you can do whatever you want. Make it look exactly how you want your text file to look.
댓글 수: 0
Ken Atwell
2014년 2월 9일
Let us say that that final.txt already have the lines you want to begin with. Use the -append option to save:
save('final.txt', 'acc', '-ascii', '-append')
If the first lines of the file happen to be header information (column names) and you are on a new release of MATLAB, you may find the table type and its writetable function to be convenient.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Data Preparation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!