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

100 ビュー (過去 30 日間)
Stacey
Stacey 2016 年 5 月 10 日
回答済み: ABDULMAJEED ALYAZIDI 2023 年 2 月 28 日
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
  1 件のコメント
Stacey
Stacey 2016 年 5 月 10 日
This worked - thank you!

サインインしてコメントする。


Kevin
Kevin 2016 年 5 月 10 日
You can also end up in debug mode if your matlab script or function calls keyboard.

ABDULMAJEED ALYAZIDI
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.

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by