write text in file

조회 수: 5 (최근 30일)
Yusuf lamah
Yusuf lamah 2020년 2월 11일
댓글: Yusuf lamah 2020년 2월 15일
how i can wtite or save output "text message' in file.txt

채택된 답변

Bhaskar R
Bhaskar R 2020년 2월 11일
편집: Bhaskar R 2020년 2월 11일
txt = 'text message';
fid = fopen('file.txt', 'wt');
fprintf(fid,'%s', txt);
fclose(fid);
  댓글 수: 8
Rik
Rik 2020년 2월 11일
You may have to use UTF-8 encoding explicitly when writing non-English text.
Yusuf lamah
Yusuf lamah 2020년 2월 15일
thanks alot for all its ok

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

fred  ssemwogerere
fred ssemwogerere 2020년 2월 11일
You can use fprintf. The link below should give you more clarity based on the data you are saving:

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by