How to store my pathdef.m

조회 수: 30 (최근 30일)
ws
ws 2011년 12월 6일
Hi all, how to store my pathdef.m in user privileges desktop.
Here are the steps I follow.
First try: Store pathdef.m in startup directory, e.g.:
'C:\Users\VS314\Documents\MATLAB'
and setup the path:
>> savepath C:\Users\VS314\Documents\MATLAB\pathdef.m
Second try: Store pathdef.m in my current system folder, e.g.:
'K:\mat\System\'
and setup the path:
>> savepath K:\mat\System\pathdef.m
Anything wrong? Or I miss some steps? Do I need to edit my code to refer the path after I set pathdef.m?
Can show me the detail steps?
Thank you.

답변 (1개)

Jan
Jan 2011년 12월 6일
I assume you do not want to save the pathdef.m file only, but you want it to be used automatically when Matlab is starting. Then the startup folder is the best location.
If you want to store it somewhere else, be sure to insert the other folder before [matlabroot]\toolbox\local in the path - e.g. use the pathtool function.
  댓글 수: 2
ws
ws 2011년 12월 7일
1. Assume I store all my codes in the startup folder(C:\Users\VS312\Documents\MATLAB\), as well as pathdef.m
2. Then use this command to save path:
savepath C:\Users\VS312\Documents\MATLAB\pathdef.m
3. What to do next? If I run my code at this step, I will not succeed.
Can you guide me step by step? Thank you.
Jan
Jan 2011년 12월 7일
What does "I run my code" and "I will not succeed" exactly mean?
If pathdef.m contains all needed folders and it is located in the folder replied by "userpath", it is used when Matlab starts up.

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

카테고리

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