From: tinne123 on 18 May 2010 11:59 Hi folks, I am puzzled by the behaviour of current directory in R2008b. Please do you know the way to ensure that only one path is active and the directory does not change? Under Preferences / Current Directory I cleared the history and set the number of recent directories for saving to 1, the one I kept in the Current directory list (top center of the console). Despite this it happens that in next sessions more directories appear in the list again. It is causing troubles while I am working with .mat files. Does please anybody know how to fix this? Many thanks for advise!!
From: Jan Simon on 18 May 2010 18:13 Dear tinne123! > I am puzzled by the behaviour of current directory in R2008b. Please do you know the way to ensure that only one path is active and the directory does not change? > > Under Preferences / Current Directory I cleared the history and set the number of recent directories for saving to 1, the one I kept in the Current directory list (top center of the console). Despite this it happens that in next sessions more directories appear in the list again. It is causing troubles while I am working with .mat files. The current directory is a single folder only. The list of formerly accessed "current" directories does not influence the reading of MAT files. So it would be necessary, that you describe your problems with some details. Jan
From: ImageAnalyst on 18 May 2010 21:03 What do you mean by active? Only one path is active for saving stuff - that is the current folder (unless you specifically give the whole path to the function that's doing the saving). Now, there is a search path, which is different than the current folder. If it's trying to find something it looks in the current folder first, then if it can't find it there it goes into the search path. If you want to get rid of that you'll have to use rmpath() I suppose. Put rmpath(genpath(path)) in your startup.m file to erase the search path. You'll have to supply the starting folder. I'm not really sure where the search path is initially defined. Maybe it's already in path, or maybe it's in some other variable - I'm not sure unless I go researching it - but once you find it, stick it in rmpath(genpath()) to try to get rid of it. You might also want to call savepath.
From: tinne123 on 19 May 2010 12:04 Hi Jan Simon and ImageAnalyst, thanks for your replies. I checked out the rmpath command. It should have the same effect as managing the paths through Set path. I am sorry if I used wrong vocabulary in my post. I will try it again from the beginning, okey? I have troubles with the Current Directory (as is displayed in R2008b above the Command Window in the default desktop layout). More specifically, I wish to use only one directory, be it C:\Program Files\MATLAB\R2008b\work, a folder I created. What I instead have are two directories in the above mentioned list, be it C:\Documents and Settings\Username\Desktop (and originally, there were some more. Matlab appears to switch from my preferred directory to this one at its start and also while working, so that I have to check the active directory before running .m files. The consequences in practice look like that I erroneously saved a couple of .mat files to PC Desktop... The list of things I have tried to avoid this: 1. Setting my desired directory as the default path under Set path and deleting the undesired paths. Alternative would be using the rmpath command and alike, as far I understood. But I doubt it has much to do with this. Please note, that C:\Documents and Settings\Username\Desktop is not included under Set path (and I even think it never was.) Yet it persists in the list to Current Directory line. 2. Under Preferences / Current Directory I cleared the history and set the number of directories to save to 1. Alternative is to adjust the cwdhistory.m manually in the preferences folder [the tip from Matlab Technical support]. I checked both. Neither of these steps prevents C:\Documents and Settings\Username\Desktop to appear in the list to Current Directory, so if I forget to look before running an .m code, mess will happen again. It is such a stupid thing, but I don't know the help. I just post this here, paralelly to further communication with the Technical Support. Maybe someone experienced the same problem with R2008b. Many thanks!!
From: Steven Lord on 19 May 2010 13:08 "tinne123 " <nastanova(a)yahoo.co.uk> wrote in message news:ht125l$2t7$1(a)fred.mathworks.com... > Hi Jan Simon and ImageAnalyst, > > thanks for your replies. I checked out the rmpath command. It should have > the same effect as managing the paths through Set path. I am sorry if I > used wrong vocabulary in my post. I will try it again from the beginning, > okey? > > I have troubles with the Current Directory (as is displayed in R2008b > above the Command Window in the default desktop layout). More > specifically, I wish to use only one directory, be it C:\Program > Files\MATLAB\R2008b\work, a folder I created. > > What I instead have are two directories in the above mentioned list, be it > C:\Documents and Settings\Username\Desktop (and originally, there were > some more. Matlab appears to switch from my preferred directory to this > one at its start and also while working, so that I have to check the > active directory before running .m files. The consequences in practice > look like that I erroneously saved a couple of .mat files to PC Desktop... I wouldn't expect MATLAB to spontaneously change your Current Directory. Can you check and make sure that you haven't changed the Start In property of the shortcut from which you started MATLAB and that you do NOT have a file named startup.m in the directory in which MATLAB initially starts up? If you do have a startup.m file, does it CD to the Desktop directory? > The list of things I have tried to avoid this: > 1. Setting my desired directory as the default path under Set path and > deleting the undesired paths. Alternative would be using the rmpath > command and alike, as far I understood. But I doubt it has much to do with > this. Please note, that C:\Documents and Settings\Username\Desktop is not > included under Set path (and I even think it never was.) Yet it persists > in the list to Current Directory line. The MATLAB path (which is what you're changing with Set Path) has nothing really to do with the current directory. > 2. Under Preferences / Current Directory I cleared the history and set the > number of directories to save to 1. Alternative is to adjust the > cwdhistory.m manually in the preferences folder [the tip from Matlab > Technical support]. I checked both. Changing the history (either contents or size) shouldn't affect whether or not MATLAB changes directory, just how many directories are recorded. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
Next
|
Last
Pages: 1 2 Prev: Polygon approximation Next: Difference between image, patch and surface |