Hi @Cg Gc, this issue occurs when the debugger gets stuck in a recursion loop and exceeds the maximum recursion limit, which corrupts the internal state. In this situation, normal exit commands like dbquit, stop, Ctrl+C, or Shift+F5 may no longer work, especially in MATLAB Online. Here are a few things you can try:
1. Try forcing the debugger to exit:
This attempts to clear all breakpoints and forcibly exit debug mode. However, in severe recursion errors, this may not be effective.
2. Refresh or restart the MATLAB Online session:
If the prompt is still stuck at K>>, try refreshing your browser tab. If that doesn't work, click your profile icon (top right in MATLAB Online) and choose "End Session", then reopen MATLAB Online. This resets the current session and should clear the stuck debugger state.
3. Preventing it in the future:
This kind of issue can happen if:
- You set breakpoints inside recursive functions.
- A callback or function is triggering recursion unexpectedly.
- There's an error in breakpoint management (especially with custom logic).
Hope this helps!