clear except...

clear workspace except prescribed variables

You are now following this Submission

This function clear all variables in the workspace except the variables listed in the function argument.
Example: clearex('var1',var2') will clear all variables in the workspace except var1 and var2.
Note: wildcards (e.g. 'var*') can be used.

Cite As

Arnaud Laurent (2026). clear except... (https://www.mathworks.com/matlabcentral/fileexchange/19548-clear-except), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

updated to enable wildcards