Diary is not saving all outputs
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Jan
le 4 Août 2018
What is a "main script"? Can you post some code which reproduces the observation?
Réponse acceptée
Jan
le 6 Août 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')
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!