After using MATLAB for many years and working as a developer at MathWorks, here are a few tricks I found extremely helpful and I would like to share them here.

Quick History Command Access

Under “HOME” tab, click on the down arrow under “Layout”. Go to “Command History” and choose “Docked”. Now you should be able to see the command history window at the bottom right corner of the editor. It presents your most recent command history, and if you want to reuse some of them, instead of retyping the commands, you can simply drag it to the Command Window.

Reference: commandhistory

Favorite Commands

If you constantly need to access a directory, or your workflow requires you to setup the environment with a few lines of commands, you can save them as your favorite commands so that instead of going through the same process every single time you restart MATLAB, you can do it by a simple click.

To do that, under “HOME” tab, click “Favorite”->”New Favorite”. Then you can label your new favorite command as, for example, “test directory”. In “Code” section, type in the command, e.g., “cd ~/home/test/”. Click “Save” and you are good to go.

Reference: favoritecommands