write text in file

2 Ansichten (letzte 30 Tage)
Yusuf lamah
Yusuf lamah am 11 Feb. 2020
Kommentiert: Yusuf lamah am 15 Feb. 2020
how i can wtite or save output "text message' in file.txt

Akzeptierte Antwort

Bhaskar R
Bhaskar R am 11 Feb. 2020
Bearbeitet: Bhaskar R am 11 Feb. 2020
txt = 'text message';
fid = fopen('file.txt', 'wt');
fprintf(fid,'%s', txt);
fclose(fid);
  8 Kommentare
Rik
Rik am 11 Feb. 2020
You may have to use UTF-8 encoding explicitly when writing non-English text.
Yusuf lamah
Yusuf lamah am 15 Feb. 2020
thanks alot for all its ok

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Tags

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by