Problem with dbstop if error in 2018b
9 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (2 件)
Stefano
2019 年 2 月 19 日
It was partially discussed in https://it.mathworks.com/matlabcentral/answers/353758-matlab-beep-at-zooming-in-plot-and-evaluating-variables
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);
end
And when trying to index the variable I:
if ~isempty(subsstr)
eval(['I = I' subsstr ';']);
end
it produces an error if varName was (in) (part of) an array of structures, objects, or symilar types with a dot, like:
struct(5).fieldname
I don't have the time to make a patch, and in any case I think it should be addressed by MathWorks...
6 件のコメント
Adrian Cherry
2023 年 8 月 24 日
Was this ever reported as a bug to Mathworks? I've just come across it in R2023a and it's f****ing annoying.
Yinjie
2024 年 3 月 16 日
% it works
if ~isempty(subsstr)
try
eval(['I = I' subsstr ';']);
catch
I = false;
end
end
参考
カテゴリ
Help Center および File Exchange で Debugging and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!