Where to store my pathdef.m

Hi all
I need to do run my project on my University lab which have user privileges and multiuser desktop, definitely I cant set path on C: directory and prompt to save pathdef.m to another destination, so where should I save my pathdef.m? In my project folder? I saw some place said that copy the pathdef.m file into your startup folder, may I know where is startup folder?
Thank you.

 采纳的回答

Jan
Jan 2011-11-30

0 个投票

The startup folder is the folder, which is active after starting up. So start Matlab and type cd.

更多回答(4 个)

Nick
Nick 2023-9-28

3 个投票

This is a bug in Matlab.
The need to change access right is a bug and not intended.
Getting admin rights is for users in companies not always possible.
Getting help from IT is for users in companies not always possible.
A tool which needs that is for such users not suitable.
(Matlab developers might see that differently, and this feedback is from user perspective)
(assume IT is outsourced)
The procedure is detailed here:
Basically setup the path the way you want. Then do
savepath foo/pathdef.m
where foo is your startup directory. You can specify the startup directory in a number of ways. On windows you can edit the shortcut ( http://www.mathworks.com/help/releases/R2011a/techdoc/matlab_env/f8-10506.html#f8-12959 ).

4 个评论

You cannot follow the link without beeing associated with a license. This will exclude a lot of students. They, and me too, would appreciate, if this part of the documentation is made public by TMW. I suggest to send a message to the technical support. The more voices they here about this, the more likely they will remove the restrictions.
I am confused. It seems like the documentation for past releases requires an account and maybe a license. I now have to think about how to share the location of "help". In general the help isn't release sensitive, but there is no easy way of getting the link to the versionless location.
Google finds the versionless location very fast- just serach for "Matlab savepath", e.g. http://www.google.de/search?q=Matlab+savepath
You find:
http://www.mathworks.de/help/techdoc/ref/savepath.html
The pattern is the same for all commands, simply replace "savepath" by the name of the command. This matchs even commands from special toolboxes.
Link to specify the startup directory is no longer active

请先登录,再进行评论。

Hi all, I still failed to store my pathdef.m. 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?
LeChat
LeChat 2021-8-10
编辑:LeChat 2023-11-21
You need to name the file along with the path your are giving.
So go to the menu Home>Set Path, then set up your path and save.
Then, in Matlab command window:
>> savepath 'C:\Users\LeChat\Documents\MATLAB\pathdef.m'
Then restart Matlab and your path should be the one you saved before.
Hope this helps.

2 个评论

Doesn't work for me. I have the same problem that I can't write files where I need to to permanently control my path
Are you on Win, MacOS, or Linux?

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

提问:

ws
2011-11-30

评论:

KE
2024-8-16

Community Treasure Hunt

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

Start Hunting!

Translated by