How to clear a specific piece of output in a Live Script?

83 views (last 30 days)
I know how to "Clear all output", but I just want to delete a few lines of code and their output.
Is that possible or do I need to run the whole live script again?

Accepted Answer

madhan ravi
madhan ravi on 29 Jun 2020
Make a section break of that lines of code.

More Answers (1)

Jared MacDonald
Jared MacDonald on 22 Mar 2021
Just to add, there is indeed a "Clear Output" right-click menu for outputs, in addition to "Clear All Output", which sounds like what you're looking for:
This doesn't remove the corresponding code.
Jared
  2 Comments
Nathaniel H Werner
Nathaniel H Werner on 2 Aug 2022
I highly encourage implementing a command to programmatically clear all or a specified output in a live script.
Alessio Ulivi
Alessio Ulivi on 4 Jul 2023
That's exactly what I would like to have. Because I have to open an image to interactively select a value, but then I don't want that image to remain as an output!

Sign in to comment.

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!