See the Limitations and Tips section of the doc for diary
Limitations
Because the output of diary is plain text, the log file does not exactly mirror what you see on screen:
- The diary file does not include graphics (figure windows).
- The diary file does not preserve syntax highlighting and font preferences.
- The diary file shows hidden components in the Command Window, such as hyperlink information generated with matlab:, in plain text. For example, if you enter this statement in the Command Windowstr = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
MATLAB displays
However, the diary file, when viewed in a text editor, shows
str = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
<a href="matlab:magic(4)">Generate magic square</a>
Tips
- To view the contents of the diary file with syntax highlighting, use the type function.