How to store my pathdef.m
34 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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 个评论
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 Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!