Can "diary" be set to export exact text where hyperlinks are invoked instead of code or other characters?

19 ビュー (過去 30 日間)
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...

採用された回答

Walter Roberson
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
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 ExchangeEntering Commands についてさらに検索

製品


リリース

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by