how i can wtite or save output "text message' in file.txt

 採用された回答

Bhaskar R
Bhaskar R 2020 年 2 月 11 日
編集済み: Bhaskar R 2020 年 2 月 11 日

0 投票

txt = 'text message';
fid = fopen('file.txt', 'wt');
fprintf(fid,'%s', txt);
fclose(fid);

8 件のコメント

Yusuf lamah
Yusuf lamah 2020 年 2 月 11 日
thank you very much it working but some text missing nit all text and not identical to output why?
Bhaskar R
Bhaskar R 2020 年 2 月 11 日
What are you getting?
Yusuf lamah
Yusuf lamah 2020 年 2 月 11 日
not exact text there are some letters repleced with symbols like'?' and not all text saved maybe my text bit about more 1000 character
Yusuf lamah
Yusuf lamah 2020 年 2 月 11 日
may text long
Bhaskar R
Bhaskar R 2020 年 2 月 11 日
"may text long" - Can you provide that text?
Yusuf lamah
Yusuf lamah 2020 年 2 月 11 日
ok i will send it when i get my lab top i am using phone now
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 日

0 投票

You can use fprintf. The link below should give you more clarity based on the data you are saving:

カテゴリ

ヘルプ センター および File ExchangeLanguage Support についてさらに検索

製品

リリース

R2016a

タグ

質問済み:

2020 年 2 月 11 日

コメント済み:

2020 年 2 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by