How can I write and save *.txt file by the *.m file in the specific path like C:\folder1\rio.txt
조회 수: 2 (최근 30일)
이전 댓글 표시
I wanna save *.txt file in specific location like C:\folder1\rio.txt that does not exit and I want to creat root its by m-file. I write below lines but it didn't work ---------- addpath('C:\folder1'); fid = fopen('rio.txt','w'); fprintf('0123456789'); fclose(fid)
and beside I have to read the *.txt file again to verify that it saved correctly. *.txt just save in current directory that I already wirte my *.m file,is someone can help me?
채택된 답변
Thorsten
2013년 1월 22일
fid = fopen('C:\folder1\rio.txt', 'w');
fprintf(fid, '%s', '0123456789');
fclose(fid)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!