Borrar filtros
Borrar filtros

save output of command window to text files in real time

4 visualizaciones (últimos 30 días)
kira
kira el 31 de Ag. de 2018
Comentada: Walter Roberson el 11 de Sept. de 2018
Hello,
diary command allow to save the output of command window to text file, but it is only updated when the codes stops its execution. What I want is a way to save the outputs as they are appearing in the command window... Is it possible?
  1 comentario
Walter Roberson
Walter Roberson el 11 de Sept. de 2018
Somewhere around R2013a-ish, diary was changed to flush after every line. Unfortunately I cannot seem to find a release note or posting about this so I cannot say exactly when it happened.

Iniciar sesión para comentar.

Respuestas (2)

Steven Lord
Steven Lord el 31 de Ag. de 2018
Start MATLAB with the -logfile option.
  1 comentario
kira
kira el 31 de Ag. de 2018
Ok, but that will save the entire session, I just want to save a particular code...

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 31 de Ag. de 2018
To display in the command window but not save, simply leave the semicolon off the end of the line of code.
To save something whenever you want, you can use fprintf() to write to either a file or the command window, however it's not automatic - you have to put each of the fprintf() lines into your program.
  1 comentario
kira
kira el 31 de Ag. de 2018
yup, this is what i have so far, but command windows outputs are not saved...

Iniciar sesión para comentar.

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by