How do i clear all except one variable?

I want to clear all variables except one
entering all variable to be cleared is a lengthy process, has many variables and function

 Accepted Answer

clearvars -except NAME

2 Comments

Thankyou it worked
clearvars -except X %deletes all variables except X in workspace

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!