clear all output code

104 Ansichten (letzte 30 Tage)
ga rec
ga rec am 12 Aug. 2019
Bearbeitet: Ahmet Sacan am 14 Dez. 2024
Is it possible in matlab live script to "clear all output" with a program code?
  13 Kommentare
Walter Roberson
Walter Roberson am 10 Nov. 2020
Yes, that is the one. Thanks, K.
Ahmet Sacan
Ahmet Sacan am 14 Dez. 2024
Bearbeitet: Ahmet Sacan am 14 Dez. 2024
I also needed to do this programmatically for a large number of mlx files. I ended up treating the mlx file as a zip file, unzipping it, replacing the matlab/output.xml with an empty file, and rezipping it all back as an mlx file. Backup your file and use this method at your own risk. It seems to confuse Matlab, but switching between output options (side-view vs. embedded view), closing & reopening the file makes it work again.
A cleaner solution (that does not confuse Matlab) is to remove just the outputArray and outputIndexes sections from the output.xml file, so that the rest of the metadata/configuration remains there.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Heather Lai
Heather Lai am 18 Okt. 2020
I would also like to encourage this functionallity. When I write code which I would like to operate iteratively after a user input, it would be very helpful for the output to be programatically cleared.
  1 Kommentar
Chris Kloppers
Chris Kloppers am 22 Okt. 2020
I also need to have this functionality. Mainly for good housekeeping, but I can think of many reasons why I would need it. It will even help to clear the output only for the current section.

Melden Sie sich an, um zu kommentieren.


Sai Bhargav Avula
Sai Bhargav Avula am 20 Aug. 2019
Currently you cannot programmatically set the clear output in Live Editor. There are only two ways to do this. First, the one you mentioned and the other by right clicking anywhere in the script and selecting the Clear All Output option.
  20 Kommentare
Duncan Carlsmith
Duncan Carlsmith am 23 Mai 2024
Me too!
John Taranto
John Taranto am 2 Sep. 2024
Ditto. Me too.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Debugging and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by