Updated 9 Jan 2013
CLEARNOT A B clears all the variables in the calling workspace except A and B (or any variable that is input to CLEARNOT).
Useful for cleaning up a cluttered workspace when you want to preserve a few variables.
The functional form of CLEARNOT is also valid: CLEARNOT('A','B').
TODO: make it work with wildcards.
clearnot a c
This clears B and D but preserves A and C in the workspace.
Andrew Bliss (2023). clearnot (https://www.mathworks.com/matlabcentral/fileexchange/39776-clearnot), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.