| MATLAB Function Reference | ![]() |
As an alternative to the pathdef function, select File > Set Path to use the Set Path dialog box.
pathdef
pathdef returns a string listing of the directories in the MATLAB® search path. Use path to view each directory in pathdef.m on a separate line.
When you start a new session, the MATLAB software creates the search path defined in the pathdef.m file located in the startup directory for MATLAB. If that directory does not contain a pathdef.m file, MATLAB uses the search path defined in matlabroot/toolbox/local/pathdef.m. It modifies the search path using any path statements contained in the startup.m file.
Make changes to the path using the Set Path dialog box and addpath and rmpath. While you can edit pathdef.m directly, use caution so you do not accidentally make unusable directories supplied by The MathWorks™. Use savepath to save pathdef.m, and to use that path in future sessions, specify the startup directory for MATLAB as its location.
addpath, cd, dir, genpath, matlabroot, partialpath, path, pathsep, pathtool, rehash, restoredefaultpath, rmpath, savepath, startup, what
MATLAB Desktop Tools and Development Environment documentation topics
![]() | path2rc | pathsep | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |