How do I make permanent changes to the MATLAB path using command line functions?

106 次查看(过去 30 天)
How do I make permanent changes to the MATLAB path using command line functions?
The ADDPATH function only adds a folder to the MATLAB path for that session of MATLAB. Once MATLAB is closed and reopened, the folder is no longer on the path. How can I save my MATLAB path so that it is used in future sessions of MATLAB?

采纳的回答

MathWorks Support Team
This enhancement has been made for Release 14 (R14). For previous product releases, please read below for any possible workarounds:
The PATH2RC function saves the current MATLAB path to the "pathdef.m" file so that it will be used in future sessions of MATLAB. Type "help path2rc" at the MATLAB prompt for more information.
You could also use the graphical path tool by doing the following:
1. Go to "File->Set Path" from within MATLAB or type "pathtool" at the MATLAB prompt.
2. Use the "Add" button to add your desired folder(s) to the MATLAB path.
3. Click "Save" so that this path is used in future MATLAB sessions.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by