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

1 visualización (últimos 30 días)
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 comentarios
Bill Tubbs
Bill Tubbs el 24 de Jul. de 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 el 25 de Jul. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

Bill Tubbs
Bill Tubbs el 24 de Jul. de 2020
Editada: Bill Tubbs el 24 de Jul. de 2020
In the end I simply force-quitted MATLAB and restarted it and it works as normal again.
(Remember to save your work first).

Más respuestas (1)

Steven Lord
Steven Lord el 24 de Jul. de 2020

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by