Yes, this week's picks are these 3 lines of code:
clear all close all clc
Is this a joke?! No, not really.
In my day-to-day job as an application engineer, I show how MATLAB can be used to solve people's problems. When I'm in front of customers, I do demo after demo, switching context left and right. I need a quick way to reset everything so that I can show the next thing they need to see. I need to run the three commands above frequently during any single customer engagement.
ccc and clr both accomplish this with a short, single command. It seems very trivial, but it's probably one of the most used commands in my job. I also use the toolstrip and shortcuts often, so I have a shortcut for ccc.
The code behind it is
Note that I actually use "close all force" to close any hidden figures.
By the way, there's an interesting discussion about the use of "clear all" in the comments section. Personally, I think it's okay as long as you know what it does, and in my case it makes sense for my day-to-day work.
Tell us about your simple shortcut commands you created to make your life just a little easier. Also, if you do have a command or a shortcut for clearing everything, what do you call it? My colleagues Sean calls it cll and Brett calls his purge. Feel free to leave a comment for Chad or Brenden as well.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.