필터 지우기
필터 지우기

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

조회 수: 16 (최근 30일)
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 CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by