From: tinne123 on 19 May 2010 14:30 Hi Steve Lord, thanks for your message. Thanks also for explaining me the proper vocabulary, I hope I won't make any typos anymore. > 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? > I would not say it happended 100%-ly spontaneously. As explained, I created the folder work myself, in C:\Program Files\MATLAB\R2008b\work as I was used to it under R2006a. I had no idea that in R2008b I need to adjust some starts ins / starts ups..? whatever it is? I think, the Current Directory created upon installation was something like User\My documents\MATLAB. That one I physically destroyed as a folder (and removed from paths, too, under Set path.) I do not quite see why Matlab created C:\Documents and Settings\Username\Desktop. Maybe because I once saved a .m file to PC Desktop (although before creating work I think), so Matlab just tried to find a possible directory? The next directory it then also added to the list was "work", although now it appears to have problems to work spontaneously, unless I do not open an .m file saved to work. I removed the one .m file from the PC Desktop and there is no startup.m file, nor anything else in common with Matlab, except for the Matlab Short Cut bar. The Current Directory Matlab sessions start with is the PC desktop, C:\Documents and Settings\Username\Desktop. Thanks for helping!
From: Jan Simon on 19 May 2010 15:55 Dear Tinne123! > I would not say it happended 100%-ly spontaneously. As explained, I created the folder work myself, in C:\Program Files\MATLAB\R2008b\work as I was used to it under R2006a. I had no idea that in R2008b I need to adjust some starts ins / starts ups..? whatever it is? > > I think, the Current Directory created upon installation was something like User\My documents\MATLAB. That one I physically destroyed as a folder (and removed from paths, too, under Set path.) When Matlab starts it has to decide for a current folder. Matlab 2008b considers mutli-user environments - if all users would start in "C:\Program Files\MATLAB\R2008b\work", there might be interferences. Therefore Matlab 2008b uses a folder depending on the currently active user. Because you have deleted this folder and removed it from the Matlab path, Matlab has to guess, which folder is apropriate. And according to the limited intelligence of Matlab, it decides for the desktop folder. A possible solution: Create the original startup folder again and restore the original Matlab path. Then create the file "startup.m" in this directory and insert this line there: cd('D:\TheFolder\YouWouldLike\ToStartAndWork\In'); with the obvious mdofications. Good luck, Jan
From: ImageAnalyst on 19 May 2010 16:44 tinne: Why don't you take a look at this closely related thread and see if that solves your problem. http://www.mathworks.com/matlabcentral/newsreader/view_thread/282031#744834 -Image Analyst
From: tinne123 on 19 May 2010 17:34 Hi Guys, thanks for your posts. To be sure, I prefer to assure myself I understand before I do someting as I saw in the ImageAnalyst post that Matlab knows to do worse than just choosing the PC Desktop. So, putting it together... >Then create the file "startup.m" in this directory and insert this line there: > cd('D:\TheFolder\YouWouldLike\ToStartAndWork\In'); > with the obvious mdofications. --------------------------------------------------------------------- Initially I had this in my startup.m file: addpath(genpath('C:\Program Files\MATLAB\Work')); cd 'C:\Program Files\MATLAB\work' 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 twice . Once you have it working with no error messages, you can delete the rmpath() command from your startup.m file if you want. ----------------------------------------------------------------------- 1.. My default folder (for the original current directory) does not exist anymore - shall I re-create it? If I do not re-create the original foder I am afraid the rmpath command would not be valid. Or may I just skip the line? 2.. At the moment, the existing startup.m file contents is this one: % Force loading of Simulink or HG or something. See g401763. close all force; try bdclose('all'); end clear all; Can I just modify the startup.m file (where it normally resides) according to the steps above: rmphath(), addpath(), cd ' ', savepath. 3... Restart console twice. Sorry that I ask so much, but I realized that one can get into trouble easily and I have respect. Many thanks for helping!!
First
|
Prev
|
Pages: 1 2 Prev: Polygon approximation Next: Difference between image, patch and surface |