What do you have in your startup.m
4 次查看(过去 30 天)
显示 更早的评论
What do you have in your startup.m file? Does anyone have a creative use (e.g. reminder of significant others birthday)?
0 个评论
回答(3 个)
Image Analyst
2015-3-14
I set my desired starting current folder, like the other people do. I also call addpath(genpath()) to add some utilities folders to my search path.
I also have "isdeployed" in there to set the current folder to different folders depending on whether it's my development computer, or a target computer for a deployed app. Your startup.m gets run on the target computer when you deploy a compiled app - something that perhaps some people don't know - so you want to make sure you don't try to set the folder to some folder that the target machine won't have.
I also call filebrowser
filebrowser; % Won't work with compiled programs.
within the ~isdeployed if block because I want to see the current folder when MATLAB starts up.
The final line of my startup.m file says
fprintf(1, 'Done running startup.m.\n');
so I know when MATLAB is done initializing and I can begin to work.
0 个评论
Star Strider
2015-3-14
I have calendar reminders and ‘Days until ...’ in my startup.m, but most important to me is that it keeps my user directories updated:
pathmat = path;
My_Path = userpath;
My_Dir = My_Path(1:strfind(My_Path,';')-1);
My_Work_Dir = genpath(My_Dir);
addpath(My_Work_Dir, '-end');
I keep all my user files and subdirectories in a directory called ‘My_Files’. This code updates any changes I might have made, and includes all new directories. It makes it easy to add new directories for FEX downloads, and since it updates them on every re-launch, they are always available. I’ve had to update it in the 15 years I've used it, to incorporate changes in the relevant MATLAB directory functions. It works with R2014 and R2015a.
0 个评论
Jan
2015-3-14
In my startup.m the default fonts are set, date and computer name are displayed to keep the overview on remote desktop activities and the title of the command window is set to the Matlab release number and bit version like "2011b/64", because I have to run tests with different Matlab versions and a fast identification is useful. Finally a tool is called to activate a set of folders for the current project.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!