How do I get rid of the K>> prompt?

195 次查看(过去 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
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
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
Kevin 2016-5-10
You can also end up in debug mode if your matlab script or function calls keyboard.

ABDULMAJEED ALYAZIDI
That becaue you're in the "Run next line mode". You should consider clicking the red stop sign to quit.

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by