MATLAB Function Reference Previous page   Next Page
savepath

Save current MATLAB search path to pathdef.m file

Graphical Interface

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

Syntax

Description

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

0
If the file was saved successfully
1
If the save failed

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

Examples

The statement

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

Consider using savepath in your MATLAB finish.m file 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, what

Search Path in the MATLAB Desktop Tools and Development Environment documentation


Previous page  saveobj scatter Next page

© 1994-2005 The MathWorks, Inc.