Clean start

Version (2.96 KB) by Julian
(Almost) Year Zero clean start
Updated 12 Jul 2016

View License

I am posting this simple script in response to Loren's Art of MATLAB blog entry
Although I do use "clear" or "clearvars" on their own interactively, fairly often I need to reset everything and make sure my class definitions are up to date etc. so this "clean start" script evolved for this purpose. But there are 2 big differences to just using clear classes on its own:
I want to keep breakpoints
I allow an emergency undo by saving state into a file

This comes at a price of how long it takes to do the save etc. I also found timer objects are very persistent so had to include a line to delete these too.

Cite As

Julian (2024). Clean start (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Workspace Variables and MAT-Files in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes