Diary is not saving all outputs
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Outputs from the mainscript with fprintf and disp are not saved in the diary BUT if this outputs come from a function they are saved. Is there an option to make the diary also save outputs from the mainscript?
2 Kommentare
Jan
am 4 Aug. 2018
What is a "main script"? Can you post some code which reproduces the observation?
Akzeptierte Antwort
Jan
am 6 Aug. 2018
I'm using a dedicated function for this job. At first this function can open some "channels" for the output, e.g. the command windows and/or files. Afterwards I call this function for all output instead of disp or fprintf. Errors are caught by try/catch, such that there is no output of my code, which is not handles by this specific output function.
It is a lot of work to adjust the complete code to such an output function. But it is worth to have the complete power over where is written what, instead of relying on diary, which has some limitations in your case.
If you are working in the Matlab environment, not in a compiled application, you can use FileExchange: CmdWinTool to get the complete text of Matlab's command window:
Str = CmdWinTool('getText')
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!