How to put a vector in a file?
조회 수: 88 (최근 30일)
이전 댓글 표시
I'd like to create a vector from 1 to 744 (vertically) and put that in a file .txt
1
2
3
..
..
744
Thanks
댓글 수: 0
채택된 답변
Stephen23
2018년 2월 14일
편집: Stephen23
2018년 2월 14일
[fid,msg] = fopen('filename.txt','wt');
assert(fid>=3,msg)
fprintf(fid,'%d\n',1:744)
fclose(fid);
Or
V = 1:744;
dlmwrite('filename.txt',V(:),'newline','pc')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!