Why do I get stuck on workspacefunc.m?
조회 수: 8 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
Pranjal Kaura
2021년 11월 24일
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!