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

조회 수: 105 (최근 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
MathWorks Support Team 2009년 6월 27일
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