clear all output code

372 views (last 30 days)
ga rec
ga rec on 12 Aug 2019
Commented: Chen Wu on 31 Mar 2024 at 14:40
Is it possible in matlab live script to "clear all output" with a program code?
  12 Comments
K.
K. on 10 Nov 2020
Regarding Walter's comment, I think I found the post where someone was trying to use clc and fprintf to show textual progress updates. If anyone is interested, I have posted a different workaround for textual progress indication that works in the Live Editor. Essentially, you can use the '\b' (backspace) character to remove characters from textual output in the Live Editor.
Walter Roberson
Walter Roberson on 10 Nov 2020
Yes, that is the one. Thanks, K.

Sign in to comment.

Answers (2)

Heather Lai
Heather Lai on 18 Oct 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 Comment
Chris Kloppers
Chris Kloppers on 22 Oct 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.

Sign in to comment.


Sai Bhargav Avula
Sai Bhargav Avula on 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.
  17 Comments
Gokhan Pekcan
Gokhan Pekcan on 23 Mar 2024 at 19:48
Obviously this is a much desired capability (which must already exists in another form); it's been requested for over three years... please...
Chen Wu
Chen Wu on 31 Mar 2024 at 14:40
I need this funtion, too, to let live script automatically remove previous outputs before new a calculation.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!