Restore "change folder" dialog box

10 views (last 30 days)
Simone
Simone on 27 Mar 2014
Answered: Simone on 10 Sep 2014
Hi all
I really appreciated the "change folder" dialog box prompted at the run of a script or even at the starting of a debug session.
It helps you to change easily to the script path without having to track for it.
Well...few days ago it mysteriously disappeared.
If I run my script now from a folder different from the one where the script is located (and that is not included in the MATLAB path) I simply receive the error due to the mismatch of current path and script path.
Do you have any idea of what can be happened?
My MATLAB version is R2013a.
Thank you in advance
Simone
  3 Comments
Preetham Manjunatha
Preetham Manjunatha on 21 Apr 2014
Edited: Preetham Manjunatha on 21 Apr 2014
Simone,
Even I had the same problem when I installed the Matlab 2014a this morning. If your last installed Matlab version is showing the change folder dialog box then try to import the preferences from the older version if it exists in the C:\Users\UserName\AppData\Roaming\MathWorks\MATLAB\R2014a. Note this path may change accordingly, if so please use PREFDIR in Matlab command window. You can see a folder(s) called R2014a, R____a/b (your old versions if any), just copy and paste carefully to R2014a. Here carefully refers to the very old version to R2014a .pref file may not be compatible. If you are copying from, say R2013 or R2012 or R2011 a/b shall work. But anyways its up to your discretion. If you find particular line in .pref file which solves the issue, then please do post your solution. In anycase if you don't have older preferences folders, then you can get the older version preference folder from other computers where latest matlab is installed, make sure to change the path (its messy), but one solution. Lastly, the cause for this issue are: 1. You didn't saved the preferences, command history files from the old version while uninstalling it. Therefore is has completely removed the preferences from the local/roaming/Mathworks folder. In fact, this led to no preferences import for the new R2014a. 2. Even I rigorously checked the Matlab options/preferences for a check box or radio button with turning that dialog box on/off. Ended up in an unsuccessful attempt! Anyways if you find some other easy solution, please do post. I believe lot of them are having the same situation!
Attention: Mathworks, Matlab team, Please consider this bug.
Thank you,
Sean de Wolski
Sean de Wolski on 21 Apr 2014
Preetham, try running:
restoredefaultpath
rehash toolboxcache
Does it fix the issue? And I would not encourage manually copying preferences directories between releases. When you install a new release or clear the preferences directory, MATLAB will incorporate as much of the old preferences as possible.

Sign in to comment.

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 27 Mar 2014
Run this code
f='E:\matlab' % for example, your desired folder
cd(f)
  2 Comments
Simone
Simone on 27 Mar 2014
Edited: Simone on 27 Mar 2014
Hi Azzi
Thank you for your reply...
The problem is not how to change directory.
The question is why such a useful dialog box has disappeared from my Matlab...
Thank you
Simone
Azzi Abdelmalek
Azzi Abdelmalek on 27 Mar 2014
Try this
desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
desktop.restoreLayout('Default')

Sign in to comment.


Simone
Simone on 10 Sep 2014
Dear All
Thank you for your replies and sorry to not have answered again, but I think the messages from Mathworks have been lost in my SPAM directory. OK, I resolved it... Azzi, it was not related to the desktop layout, thank you anyway. The problem is that the directory that contains the file I'm trying to run IS included in the MATLAB path and therefore MATLAB does NOT look for it. As my script loads some other files in other directories with relative path, if I'm not in the same directory containing the script I'm trying to run I do NOT receive a change folder prompt window (because the script is included in the MATLAB path) but the script does NOT work properly because it looks for files in other directories that are not found in the relative paths declared inside the script. The solution has been to remove the directory containing the script from the MATLAB path and now, if I run the script from another directory, MATLAB asks to me if I want to change the directory to reach the script's one. It was a silly misunderstanding...
Thank you all for your replies.
Best regards Simone

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!