write text in file

5 visualizzazioni (ultimi 30 giorni)
Yusuf lamah
Yusuf lamah il 11 Feb 2020
Commentato: Yusuf lamah il 15 Feb 2020
how i can wtite or save output "text message' in file.txt

Risposta accettata

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

Accedi per commentare.

Più risposte (1)

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

Tag

Prodotti


Release

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by