write text in file

2 ビュー (過去 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 Center および File ExchangeLanguage Support についてさらに検索

タグ

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by