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

1 vue (au cours des 30 derniers jours)
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 commentaires
Bill Tubbs
Bill Tubbs le 24 Juil 2020
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 le 25 Juil 2020
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.

Connectez-vous pour commenter.

Réponse acceptée

Bill Tubbs
Bill Tubbs le 24 Juil 2020
Modifié(e) : Bill Tubbs le 24 Juil 2020
In the end I simply force-quitted MATLAB and restarted it and it works as normal again.
(Remember to save your work first).

Plus de réponses (1)

Steven Lord
Steven Lord le 24 Juil 2020
  1 commentaire
Bill Tubbs
Bill Tubbs le 24 Juil 2020
As explained in comments above, no commands are working at the moment (they raise the same errors above).

Connectez-vous pour commenter.

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Tags

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by