Respuesta aceptada

Bhaskar R
Bhaskar R el 11 de Feb. de 2020
Editada: Bhaskar R el 11 de Feb. de 2020

0 votos

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

8 comentarios

Yusuf lamah
Yusuf lamah el 11 de Feb. de 2020
thank you very much it working but some text missing nit all text and not identical to output why?
Bhaskar R
Bhaskar R el 11 de Feb. de 2020
What are you getting?
Yusuf lamah
Yusuf lamah el 11 de Feb. de 2020
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 el 11 de Feb. de 2020
may text long
Bhaskar R
Bhaskar R el 11 de Feb. de 2020
"may text long" - Can you provide that text?
Yusuf lamah
Yusuf lamah el 11 de Feb. de 2020
ok i will send it when i get my lab top i am using phone now
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

0 votos

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

Categorías

Productos

Versión

R2016a

Etiquetas

Preguntada:

el 11 de Feb. de 2020

Comentada:

el 15 de Feb. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by