Why do I get stuck on workspacefunc.m?

7 visualizaciones (últimos 30 días)
Mitchell Tillman
Mitchell Tillman el 21 de Nov. de 2021
Respondida: Pranjal Kaura el 24 de Nov. de 2021
Ever since I have started using appdesigner, I have a frequently reoccurring issue with a built in Matlab function called 'workspacefunc.m'. I always get stuck on line 310 of this function, which is: (Matlab's comments included)
% try to eval the variable here, instead of when calling
% the function, so that we can catch any errors and prevent
% error beeping
v = evalin('caller', varargin{1});
When I get stuck on this function, oftentimes there is no way for me to quit debugging and rerun my code. I have to resort to exiting Matlab, which is a huge pain. Sometimes after clicking on it dozens of times in a row very fast, I can get the error to go away without restarting.
Matlab does not provide me with an error code. Also, as far as I can tell this error is not due to a syntax or logic error. It happens when debugging, after setting a breakpoint.
Is there something I'm missing here? Why is this happening?

Respuestas (1)

Pranjal Kaura
Pranjal Kaura el 24 de Nov. de 2021
Hey Mitchel,
Thank you for bringing this up. I have heard that this issue is known and the corresponding parties may be investigating further.
A possible cause of this issue is:
Entering the command
>> path(<new directory>)
instead of
>> addpath(<new directory>).
This command changes the search path to its argument, which should be a string of folders. Herein specifying only one folder, renders MATLAB installation unusable, since MATLAB cannot find any of the important .m files it needs to execute while processing any commands entered - workspacefunc.m being one of them.
Exiting and restarting MATLAB should resolve this issue, since the default MATLAB path is restored if "savepath" is not called.
In the future, instead of the "path" command, please use the "addpath" command. This simply adds an extra folder to the pre-existing path instead of overwriting the entire MATLAB path
Hope this helps!

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by