cch - close, clear, home

CCH saves keystrokes in resetting MATLAB by running the commands close, clear, and home.
Updated 23 Feb 2016

View License

CCH accepts arguments to be passed to the CLEAR command. If one of the arguments is '-BREAKS', breakpoints will not be cleared.
By default (modifiable), CCH by itself with no arguments is the same as CCH -BREAKS.
Over the years, I've used a micro-script version of this on the order of dozens or even hundreds of times in a typical day of using MATLAB. It's also the first line of many of my utility scripts and shortcuts.
There are two similar submissions on the file exchange, but both use "clc" instead of "home", which in my experience sometimes results in throwing away useful command window history information when you wish you hadn't. I'm therefore a proponent using "home" over "clc" — perhaps I can convert some users with this submission.

Cite As

Sky Sartorius (2024). cch - close, clear, home (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: clr == clear all; close all; clc;, Clear Most, ccc

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Simplified fclose.

'all' argument no longer default for the sake of speed.

breakpoint preservation; passing args to clear command

breakpoint preservation; passing args to clear command