Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to write different outputs in different text files

1 visualización (últimos 30 días)
Kawsar Jahan
Kawsar Jahan el 24 de Jun. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hi, I want to write five different variable values to five different text files. But I do not know how to open five different .txt files in the same code. any help regarding this will be appreciated.
Thanks

Respuestas (1)

Star Strider
Star Strider el 24 de Jun. de 2015
You have to open them individually:
fid1 = fopen('testfile1.txt', 'wt');
. . .
fid5 = fopen('testfile5.txt', 'wt');
WRITE TO FILES, THEN CLOSE THEM
fclose(fid1);
. . .
fclose(fid5);
or if you don’t have any other files open that you want to keep open, you can use:
fclose('all');

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by