Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: 'ghost' path?
Posted:
May 12, 2010 8:57 PM


On May 12, 7:49 pm, "Theophane " <theo.we...@hotmail.com> wrote: > ImageAnalyst <imageanal...@mailinator.com> wrote in message <1dc0477253504ef29ac6e9f9b2145...@l28g2000yqd.googlegroups.com>... > > Try rmpath, passing it the path that no longer exists. Then call > > savepath. > > Didn't work :/ > the specified directory is not in the path, matlab says (quite justifiably so, since this directory does not exist).
 Theophane: It DOES work. I just tried it. Twice! And I'll show you how. Initially I had this in my startup.m file:
addpath(genpath('C:\Program Files\MATLAB\Work')); cd 'C:\Program Files\MATLAB\work'
and all was well with the world. Then I exited MATLAB (required in order to rename a folder it's using). I renamed my work folder to work1 and relaunched MATLAB. All hell broke loose. MATLAB then complained about numerous missing folders in a volcanic explosion of barf to the command window.
I then edited the startup.m file to put in take out the above lines and put these in:
rmpath(genpath('C:\Program Files\MATLAB\Work')); addpath(genpath('C:\Program Files\MATLAB\Work1')); cd 'C:\Program Files\MATLAB\work1' savepath;
I then saved it, and restarted MATLAB. It complained at first in the same way, because it was checking the folders before it ran the startup.m file. But then the startup.m file ran and "fixed" it. I simply exited MATLAB and restarted it . . . and everything was fine. MATLAB started up with a smile, the birds were singing, and all was again well with the world. No supernova of vomit to the command window.
Then just to verify, I renamed my folder back to work (from work1) and repeated the process. It worked just like I explained.
Once you have it working with no error messages, you can delete the rmpath() command from your startup.m file if you want.
I don't know if this is the most direct and straightforward way of doing it, but I know it works. All it takes is restarting MATLAB twice. If you want to fix your problem, you can do this also.
Good luck, ImageAnalyst



