Faq get message Path cannot be saved and cannot write to pathdef.m file

From Eigenvector Research Documentation Wiki
Revision as of 09:21, 2 April 2020 by Scott (talk | contribs)
Jump to navigation Jump to search

Issue:

I get the message "Path cannot be saved" and don't seem to have permission to write to my 'pathdef.m' file. What can I do to keep from having to install PLS_Toolbox each time I start Matlab?

Possible Solutions:

In some cases, Matlab will be installed where you cannot save the Matlab path. This will usually be observed by error messages regarding saving of the path or by the fact that the path resets itself when you restart Matlab. A quick test to see if you can save your path is to run the command savepath. If this returns an error, you should use this FAQ to help work-around the problem.

Preferred Solution

Run the following commands to check for the 'userpath' and reset it if needed. Then save a new pathdef file to your userpath location that will be used when you install PLS_Toolbox.

if isempty(userpath);userpath('reset');end;savepath(fullfile(userpath,'pathdef.m'))​


Alternative Solution Manually copy your pathdef.m file to the userpath location.

  1. Type the command:
    >> which pathdef.m
    and note the folder.
  2. Type the command:
    >> userpath('reset');userpath
    and note the folder (ignore the ; at the end of the folder name)
  3. Copy (Do Not Move, COPY) the file identified in step 1 into the folder identified in step 2.


Still having problems? Please contact our helpdesk at helpdesk@eigenvector.com