savepath - Save current search path to pathdef.m file

GUI Alternatives

As an alternative to the savepath function, use the Set Path dialog box. To open it, select File > Set Path in the MATLAB® desktop.

Syntax

savepath
savepath newfile

Description

savepath saves the current search path MATLAB uses to pathdef.m. It returns

0

If the file was saved successfully

1

If the save failed

savepath newfile saves the current search path to newfile, where newfile is in the current directory or is a relative or absolute path.

Examples

The statement

savepath myfiles/pathdef.m

saves the current search path to the file pathdef.m, which is located in the myfiles directory in the current directory for MATLAB.

Consider using savepath in your finish.m file for MATLAB to save the path when you exit MATLAB.

See Also

addpath, cd, dir, finish, genpath, matlabroot, partialpath, pathdef, pathsep, pathtool, rehash, restoredefaultpath, rmpath, savepath, startup, userpath, what

Search Path in the MATLAB Desktop Tools and Development Environment documentation

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS