Saving the command window to file
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
BH
el 30 de Ag. de 2015
Respondida: Star Strider
el 30 de Ag. de 2015
I have written a script that runs a few calculations and displays some results in the command window, mostly by using the disp function but also partly by using the fprintf function. It would be better if I could save all these results to a file (ideally pdf or something that could be converted to pdf). Is there a simple way to modify my script to do this? I have 2 figures that this script plots that I would like to keep separate.
0 comentarios
Respuesta aceptada
Star Strider
el 30 de Ag. de 2015
I would use fprintf for everything, remembering that the first argument can be a fileID created by fopen. It is likely not difficult to write fprintf calls to emulate your disp calls. You can then save all your results to that file.
As for the figures, you can use the print, saveas, or savefig functions to save them. (The savefig function is likely the best, because it also retains the data and other information used to create it. You can create images from it later as necessary.)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Printing and Saving en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!