green arrow for current line and variable values not displaying during debug pause at breakpoint
Show older comments
When debug breakpoint pauses my code it does not display the green arrow (on the left next to lthe line number) showing where in the code the script is paused.
Also it does not display the variable vaules when you hover the mouse over.
See the screen shot of a pause at a break point during debugging

Accepted Answer
More Answers (2)
Walter Roberson
on 20 Sep 2023
0 votes
The highlight might not align properly if you edit the file during debugging.
2 Comments
Kris
on 20 Sep 2023
Walter Roberson
on 21 Sep 2023
The only circumstances under which the green "current line" highlight can point to a line that has no code in it are:
- if you paused in the debugger and that line originally had code on it but you editted the file since you started running it, so that the line numbers known to the executing code are different than the line numbers that are in the file
- if you were executing the function by way of a function handle, and you editted the function through an external editor and MATLAB did not notice that it was modified
- if you were executing the function by way of a function handle, and you modified the function by way of code, and you did not "clear" the function before you executed the handle again
- (there could potentially be bugs that I have not heard of)
There is an additional situation under which the debugger could end up pointed at the "wrong" line -- but would not end up pointing to an empty line. The circumstance is that you happened to use one of the coding patterns that MATLAB was able to convert into a call to a high performance external routine. In such a case, what is being executed internally is not going to be match the code and the debugger information would be set to the last executable phrase of the replaced section -- typically an "end" statement.
Image Analyst
on 21 Sep 2023
Edited: Image Analyst
on 21 Sep 2023
0 votes
So it stopped on line 68 but there is no green arrow pointing to that line? It could be some kind of display adapter issue. What operating system are you using?
You have a 2 year old version. Can you upgrade to r2023b?
You should not have the parentheses on the for line on line 68.
You do not need the ==1 on line 71 since is_data_file is already a boolean.
Don't use i as the for loop iteration since i is the imaginary constant.
Categories
Find more on Shifting and Sorting Matrices 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!