Is it possible to 'clear all' variables except one?
51 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Zeynab Mousavikhamene
am 5 Sep. 2019
Beantwortet: James Tursa
am 5 Sep. 2019
I am using clear all command. But I wan to keep just one of the varibles. Lets say the name of that variable is 'var'.
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 5 Sep. 2019
Bearbeitet: madhan ravi
am 5 Sep. 2019
clearvars -except var
0 Kommentare
Weitere Antworten (2)
Walter Roberson
am 5 Sep. 2019
No, that is not possible using "clear all"
The only time you should ever use "clear all" is if you are deliberately resetting your entire MATLAB session. If it would not be acceptable to quit and re-enter MATLAB at that point then you should not use "clear all"
You should have a look at the clearvars() command, which does have an -except option.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!