필터 지우기
필터 지우기

pathdef.m is not run at startup?

조회 수: 17 (최근 30일)
Troy McClure
Troy McClure 2021년 4월 26일
댓글: Troy McClure 2021년 4월 26일
I have a pathdef.m file that I've placed in C:\Program Files\MATLAB\R2019b\bin. After starting MATLAB, I enter 'cd' and it outputs C:\Program Files\MATLAB\R2019b\bin. But when I click Set Path to see my path, it's obvious that the pathdef.m file has not been run since there are paths missing. How can I tell it to run at startup? Also, is there a command line argument to to specify the pathdef.m file to use, which may work better?

채택된 답변

Jan
Jan 2021년 4월 26일
Do not store anything in Matlab's bin folder.
If you click "Set Path", Matlab loads the first pathdef.m file, which is found in Matlab's PATH. The bin folder does not belong to the path.
Leave pathdef.m where it is or add it to your user folder. If you are working on a single user machine, adjusting pathdef.m inside <matlabroot>\tools\local works, if you give write access for this (and only this) folder to your account. On a multi user system, it is saver not to touch pathdef.m but to use e.g. startup.m to add folders.
  댓글 수: 3
Jan
Jan 2021년 4월 26일
편집: Jan 2021년 4월 26일
"My Documents\MATLAB" might be the first folder, after pathdef.m ran.
You can determine the startup folder in the preferences. Choose the folder, which conatins your pathdef file.
Troy McClure
Troy McClure 2021년 4월 26일
Changing the initial working folder in preferences didn't seem to work, but the startup script in your link did. Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by