write text in file

5 visualizaciones (últimos 30 días)
Yusuf lamah
Yusuf lamah el 11 de Feb. de 2020
Comentada: Yusuf lamah el 15 de Feb. de 2020
how i can wtite or save output "text message' in file.txt

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (1)

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

Categorías

Más información sobre Language Support en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by