FUNCTION REFERENCE

diary

Record command-window output in a file.

Record command-window output in a file.

Syntax

diary filename; diary(filename); diary on; diary off; diary

Output is appended to the file while the diary is on; diary without arguments toggles it. get(0, 'Diary') and get(0, 'DiaryFile') report the state. A file that cannot be opened or written is an error and leaves the diary off.

Example

diary off; get(0, 'Diary')   % off

Differences from MATLAB: The commands typed are not recorded, only the output. Output captured by evalc is recorded too (MATLAB turns the diary off inside evalc).

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.