Undefined function 'workspacefunc' — How to change search path back after accidentally changing it

조회 수: 1 (최근 30일)
I couldn't remember the function to check if a directory exists so I typed the following, and then accepted the suggested correction:
>> ispath('plots')
Unrecognized function or variable 'ispath'.
Did you mean:
>> path('plots')
Warning: Name is nonexistent or not a directory: /Users/billtubbs/gel-2005/notes/10/plots
> In path (line 34)
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
com.mathworks.jmi.MatlabException: Method 'workspaceUpdated' is not defined for class 'internal.matlab.variableeditor.MLNamedVariableObserver' or is removed from MATLAB's search path.
Now I get these errors whatever command I type (including path). I can't even quit MATLAB.
How do I recover from this situation?
Ideally I would like to restore whatever paths I had set up before typing the above command.
  댓글 수: 10
Bill Tubbs
Bill Tubbs 2020년 7월 24일
Maybe I am mistaken. It's mentioned by MathWorks Support Team in the link above as a possible remedy:
sudo chmod 777 $MATLABROOT/toolbox/local/pathdef.m
Anyway, it doesn't work ("No such file or directory") as you suggest. I commented on the post to that effect.
Walter Roberson
Walter Roberson 2020년 7월 25일
The environment variable MATLABROOT is not expected to exist; where the documentation refers to $MATLABROOT it is described as being the MATLAB installation directory. It is an abbreviation for writing in "MATLAB Installation directory path goes here".
It can be misleading to people who are accustomed to actual environment variables.
MATLAB will not pay any attention to an environment variable MATLABROOT when it is executing; MATLAB constructs its notion of matlabroot() based upon the location of the MATLAB executable.

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

채택된 답변

Bill Tubbs
Bill Tubbs 2020년 7월 24일
편집: Bill Tubbs 2020년 7월 24일
In the end I simply force-quitted MATLAB and restarted it and it works as normal again.
(Remember to save your work first).

추가 답변 (1개)

Steven Lord
Steven Lord 2020년 7월 24일
  댓글 수: 1
Bill Tubbs
Bill Tubbs 2020년 7월 24일
As explained in comments above, no commands are working at the moment (they raise the same errors above).

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

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by