If you work with multiple Matlab instances open, you will soon realise that only one instance's history will be recorded -- the rest of your commands are lost forever.
I work on several different projects at the same time, so I needed a way to save my Matlab history per-project (similar to R / R-studio).
This function will write the history of your current session in a plain format Matlab file (.m). If you give it an existing filename, your history will be appended to the file's current contents.
George (2019). saveHistory.m (https://www.mathworks.com/matlabcentral/fileexchange/47681-savehistory-m), MATLAB Central File Exchange. Retrieved .