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

7 visualizzazioni (ultimi 30 giorni)
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

Risposte (1)

Steven Lord
Steven Lord il 7 Mag 2024
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 Commento
Duncan Carlsmith
Duncan Carlsmith il 7 Mag 2024
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.

Accedi per commentare.

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Prodotti


Release

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by