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

2 次查看(过去 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

类别

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