diary not saving to file all output to command window

Hi,
My script often calls functions from various 3rd party Matlab toolboxes. Although I set diary() at the beginning of my script, a lot of the output to the command history from these functions aren't saved into my diary output. Is there an alternative to diary() that will always direct all types of output to a file? Are there different types of output that a redirected differently in Matlab (like the Unix I/O redirection difference between stderr and stdout although what's not writing into my Matlab diary is not always errors but also normal disp() messages). Or is there a command that I can execute in the command window before/after running my script that will dump everything in the command window into a file?
Thanks in advance! g

Answers (1)

Jan
Jan on 6 May 2016
Edited: Jan on 6 May 2016
You can obtain the contents of the command window by FEX: CmdWinTool .
Please explain which parts of the output are missing: Error message? Warnings? Hyperreferences? Text written by Mex-functions?

2 Comments

Thanks for your prompt reply, Jan! The outputs that are missing in my diary file include messages printed to the command window via fprintf() and disp() -- I didn't look through all the instances when this happens...I'm calling third-party functions that call other gazillion other functions. Doing a grep on all the files of these toolboxes to search for what code file is responsible for the messages I see in the command window but not in my diary file doesn't always give me a match (i.e. can't locate what code create the messages) -- which makes me think that these toolboxes include non-Matlab functions? But I don't know much about C/Mex functions to know how to locate the functions that could be causing diary to maybe reset -- so not sure how to locate the code in order to answer your question more completely....
Hi Jan,
Sorry for resurrecting this here but I have the same problem. 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?

Sign in to comment.

Categories

Find more on Scope Variables and Generate Names in Help Center and File Exchange

Asked:

on 6 May 2016

Commented:

on 27 Jul 2018

Community Treasure Hunt

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

Start Hunting!