How to make MATLAB always start with the previous directory when using the menu?

Hey
Is there a way to make MATLAB always open the last used directory?
For instance, when saving a figure, importing data through the menu, etc. etc. it always revert back to some default folder (for instance, "This PC --> Documents --> MATLAB"
How can I make MATLAB always open the last folder I navigated to? I've looked through the preferences tab, but cannot find any settings that seem to do this.
I'm not interested to make this happen in any scripts etc. to be clear, just when using the menues in the graphical interface of MATLAB.
Kind regards,
Carl

 Accepted Answer

Yes, as long as you start MATLAB from a shortcut icon on your desktop, you can set the "Initial Working Folder" setting in the Preferences dialog to make MATLAB remember its last folder. See here for more details on setting this up: https://www.mathworks.com/help/matlab/matlab_env/start-matlab-on-windows-platforms.html

3 Comments

Hi and thanks for your answer.
It is not exactly this that I'm searching for, rather that if it is possible to make MATLAB remember the last folder I accessing (regardless of what the current working folder is).
E.g. lets say MATLAB's initial working folder is A\B\C. Now, I've made a figure, and choose "Save as" in figure editor window and navigate to folder X\Y\Z where I want to save it.
I then make a new figure and choose "Save as". Now I am back in the folder A\B\C, but I want to be in X\Y\Z. Thus, I need to navigate back to this folder again etc. MATLAB always open the current working folder, but not the last folder I was saving or importing data from.
Is this possible to set somewhere?
Kind regards,
Carl
I don't think this is possible as a preference or something similarly simple in MATLAB.
Dialogs like Save As or File Open will always open at your current directory. Which directory you used previously to open or save files won't be remembered.
Ok, thanks for giving me an answer :)
I'll make this as a wish for the future!

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!