The ability to select an arbitrary location for the MATLAB path file 'pathdef.m' is not available in MATLAB 8.1 (R2013a). One possible workaround is detailed below.
By default, the 'pathdef.m' file may be located in either the '$MATLABROOT/toolbox/local' directory or the '$USERPATH' directory, where $MATLABROOT and $USERPATH are the directories displayed after entering the commands
and
at the MATLAB command line respectively.
The 'pathdef.m' file can be manually copied from either of these directories and placed in an arbitrary directory. To use the copied 'pathdef.m' file at initialization, create a MATLAB file titled 'startup.m' and place it in the '$USERPATH' directory. Copy the lines of code below to the file. If a 'startup.m' file already exists in '$USERPATH', add the lines of code to the end of the file:
startdir = pwd ;
pathdir = '<MODIFY>' ;
cd(pathdir)
path(pathdef)
cd(startdir)
Make sure to modify the string marked "MODIFY" in the above code to the directory to which the 'pathdef.m' file was copied. The 'startup.m' script will be automatically executed upon MATLAB initialization.
Best Answer