Problem with dbstop if error in 2018b

30 views (last 30 days)
JWall on 13 Jan 2019
Commented: Stefan on 29 Feb 2020
After downloading Matlab 2018b, I started having the following problem using the command dbstop if error:
My code will stop at the error as usual but then at some point later as I am debugging (typing variable names in the command line to check their values, etc.), the debugger will stop at line 43 of getArrayEditorBrushCache which reads:
eval(['I = I' subsstr ';']);
Then I have to type dbclear if error to escape the debugger and start my program over.
This is happening to me in many of my programs where dbstop if error was working fine in previous versions of Matlab. Any ideas for how to solve this or is this just a new bug?

Answers (2)

madhan ravi
madhan ravi on 13 Jan 2019
When it occurs type
dbquit % help dbquit to know more

Stefano on 19 Feb 2019
There is an awful (IMHO) piece of code for taking the indexes of an array:
parenStart = strfind(varName,'(');
subsstr = '';
if ~isempty(parenStart)
subsstr = varName(parenStart:end);
varName = varName(1:parenStart(1)-1);
And when trying to index the variable I:
if ~isempty(subsstr)
eval(['I = I' subsstr ';']);
it produces an error if varName was (in) (part of) an array of structures, objects, or symilar types with a dot, like:
I don't have the time to make a patch, and in any case I think it should be addressed by MathWorks...
Stefan on 29 Feb 2020
@Andrei: I have the same bug and permission problem.
A temporal workaround is to modify getArrayEditorBrushCache.m according to Jan's above patch and save it into your working folder. For me, this perfectly solved the issue.

Sign in to comment.


Find more on Debugging and Analysis in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by