Diary is not saving all outputs
4 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Jan
on 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')
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!