How do I get rid of the K>> prompt?
조회 수: 99 (최근 30일)
이전 댓글 표시
I keep getting stuck in K>> mode. I've tried hitting return several times, typing dbquit, home, and clc. None of these work. I'm using version R2015b. Thanks in advance for your help.
댓글 수: 1
Stephen23
2016년 5월 10일
To quit the debugger:
press Shift + f5
or call
dbquit
To continue running the code:
press f5
IMPORTANT: calling dbquit or shift+f5 does not clear the breakpoints from your files: as the documentation clearly states "All breakpoints remain in effect". So the next time the function runs (either by calling it or within a loop or callback) then MATLAB will enter debug mode again.
If the code is looping then you can use conditional breakpoints to avoid this.
Also if you have nested debugs then this only escapes the highest level debug mode...
답변 (3개)
Guillaume
2016년 5월 10일
You've got a K>> prompt because you've entered debug mode within a function, either because you put a breakpoint there yourself, or because you've issued a dbstop if error and an error occurred in the function.
home and clc will have no effect on that, but despite what you say dbquit will leave debug mode. If you still have a K>> prompt after dbquit is because you've reentered debug mode while already in a debug session. If you issue enough dbquit you will eventually leave debug mode.
Most likely, you're in this situation because you've issued dbstop if error, hit an error and thus entered debug mode, try to run the function that produced the error without leaving debug mode, meaning that you've entered a new debug mode again, and done that a few more times. So you're in a K>> prompt within a K>> prompt within a K>> prompt, ...
To escape from all these recursive debug sessions:
dbquit all
To stop entering debug mode on error:
dbclear if error
Kevin
2016년 5월 10일
You can also end up in debug mode if your matlab script or function calls keyboard.
댓글 수: 0
ABDULMAJEED ALYAZIDI
2023년 2월 28일
That becaue you're in the "Run next line mode". You should consider clicking the red stop sign to quit.
댓글 수: 0
참고 항목
카테고리
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!