I would like to set some initial variables (like format compact
and the current directory) automatically on each startup of Matlab.
How can I do that?
views:
938answers:
2
+5
A:
Create a startup.m script file containing the commands to set up the state that you want. Next, from inside MATLAB, run the command
>> userpath
This will give you a list of one or more user-specific directories (depending on what OS you are using); put your startup.m in any of those directories and it will be found whenever you start MATLAB (startup.m is also found if it is in the directory from which MATLAB is started, but the technique above allows you to start MATLAB from an arbitrary directory and still have startup.m get run).
SCFrench
2008-10-18 01:51:58
userpath returns only a single : on my standard OSX-installation.
BastiBechtold
2008-10-19 07:51:40
What version of MATLAB are you using?
SCFrench
2008-10-19 17:34:27
I am using Matlab 2007a. I put the file in the Matlab root directory. It works fine. Thank you!
BastiBechtold
2008-10-20 14:10:15