clear all output code

조회 수: 111 (최근 30일)
ga rec
ga rec 2019년 8월 12일
편집: Ahmet Sacan 2024년 12월 14일
Is it possible in matlab live script to "clear all output" with a program code?
  댓글 수: 13
Walter Roberson
Walter Roberson 2020년 11월 10일
Yes, that is the one. Thanks, K.
Ahmet Sacan
Ahmet Sacan 2024년 12월 14일
편집: Ahmet Sacan 2024년 12월 14일
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.

댓글을 달려면 로그인하십시오.

답변 (2개)

Heather Lai
Heather Lai 2020년 10월 18일
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
Chris Kloppers
Chris Kloppers 2020년 10월 22일
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.

댓글을 달려면 로그인하십시오.


Sai Bhargav Avula
Sai Bhargav Avula 2019년 8월 20일
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
Duncan Carlsmith
Duncan Carlsmith 2024년 5월 23일
Me too!
John Taranto
John Taranto 2024년 9월 2일
Ditto. Me too.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by