フィルターのクリア

Live Editor long display output bug. Command to remove output from Live Script?

16 ビュー (過去 30 日間)
Duncan Carlsmith
Duncan Carlsmith 2024 年 5 月 7 日
コメント済み: Duncan Carlsmith 2024 年 5 月 7 日
I bug I recently encountered corrupted my Live Script so it was not openable. Using symbolic methods, I had generated a formula apparently exceeding the 63k character limit for display in a Live Script. The Script crashed with a cyptic error and when I tried to open it, MATLAB simply hung with a blank Live Editor frame. The 'Clear All Output' option was greyed out like other Live Editor Tools.
Suspecting Live Editor was trying fruitlessly to render output, I searched the interweb and MathWorks for a command line commmand to clear output and found none so resorted to my trick of prying the .mlx open with BBEdit, opening the output file which was, er, lengthy, selecting all, deleting, and saving, wondering if I would damage the mlx, but it worked. Anyway, it would be great if there was a command to do this from the command line. Anyone one know of one? I built my own workaround below. Of course it would be great if display() had a character limit check like this and better if it provided arguments to customize how to handle large outputs, e.g. redirect to a file as oposed to trying to display and in the Live Script case render.
function Symdisplay=Symdisplay(symbolicinput)
if length(char(symbolicinput))>5000
SymDisplay="Too long to display"
else
Change display to disp to not show the name of the variable being displayed.
display(symbolicinput);
end
end

回答 (1 件)

Steven Lord
Steven Lord 2024 年 5 月 7 日
Please send the Live Script with which you were able to reproduce this error to Technical Support directly using this link so that the Support staff and the development staff can investigate this bug.
  1 件のコメント
Duncan Carlsmith
Duncan Carlsmith 2024 年 5 月 7 日
Thanks for responding so quickly Steven. I did submit a bug report. The file is https://www.mathworks.com/matlabcentral/fileexchange/165336-fisher-information-explorer?s_tid=srchtitle if you care to reproduce it. Just remove the line in Symdisplay that checks for excessive characters.
There are other times I might like to remove the ouput from a Live Script that I can't open in the Live Editor or want to open clear from old output so I think a >>clear( asdfadf.mlx,'output') type command might be useful.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAdding custom doc についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by