Can "diary" be set to export exact text where hyperlinks are invoked instead of code or other characters?
19 ビュー (過去 30 日間)
古いコメントを表示
Clay Fulcher
2025 年 12 月 5 日 0:50
コメント済み: Clay Fulcher
2025 年 12 月 5 日 15:31
The output of "diary" echoes what appears in the Command window, except for certain hyperlinks invoked by Matlab. Is there a way to echo literally what appears on the screen instead of code?
For example,
str = sprintf('%s%s', ...
'<a href="matlab:magic(4)">', ...
'Generate magic square</a>');
disp(str)
MATLAB displays this in the Command Window:
However, the diary file, when viewed in a text editor, shows this text instead:
<a href="matlab:magic(4)">Generate magic square</a>
Thanks in advance...
0 件のコメント
採用された回答
Walter Roberson
約21時間 前
No. In order for that to work, the entire file would need to be formatted as HTML.
Formatting the file as HTML would involve more than adding in a <HTML> header. HTML treats all whitespace as being equal, and does automatic line wrapping, so it would be necessary to add in <BR> at the end of every line and convert spaces to <nbsp;> to get the right formatting.
3 件のコメント
Walter Roberson
約15時間 前
Code could be written that parsed diary entries and emitted HTML. It would be a matter of substituting <nbsp;> for all spaces except for <a href and then putting in <br> at the end of every line, and finally wrapping with <HTML> headers.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!