How to Clear all Variables of a Workspace Except for Those Explicitly Excluded?

How do I clear all variables of a workspace except for those that I explicitly mention not to be cleared?

 Akzeptierte Antwort

Jan
Jan am 15 Mär. 2017
Bearbeitet: Jan am 15 Mär. 2017
clearvars -except keepVariables
I recommend to use functions. Then there is no need to clear workspace variables. For larger projects it is very useful, if the workspace is kept clean, instead of applying method to clean them manually.

Gefragt:

am 15 Mär. 2017

Bearbeitet:

Jan
am 15 Mär. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by