write text in file

3 vues (au cours des 30 derniers jours)
Yusuf lamah
Yusuf lamah le 11 Fév 2020
Commenté : Yusuf lamah le 15 Fév 2020
how i can wtite or save output "text message' in file.txt

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (1)

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

Tags

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by