keep
Version 1.0.0.0 (810 Bytes) by
David Yang
KEEP is complementary to the "clear" command: it keeps the supplied variables and deletes the rest.
17.3K Downloads
Updated
10 Aug 1999
No License
Editor's Note: This file was a File Exchange Pick of the Week.
KEEP is complementary to the "clear" command: instead of clearing the supplied variables, it keeps them and deletes the rest.
For example, the command " keep x y " clears all variables from the workspace except x and y.
Cite As
David Yang (2025). keep (https://www.mathworks.com/matlabcentral/fileexchange/181-keep), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R10
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Workspace Variables and MAT-Files in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired: keep2, KEEP3, keepfield, Keep4, Clear All But
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.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |