MATLAB: Detect debug mode

debuggingMATLAB

is there a way to tell if your function has been called from the "k>>" debug prompt instead of the normal ">>" prompt?
Something like an "isdebug()" function??
Thanks
Ronan

Best Answer

I don't think there is a robust way to tell. For example, you can get the "k>>" prompt with a keyboard command and I have no idea how to tell if the keyboard command has been called.
If you just want to tell if you are at a standard break point you can probably check each item in dbstack against the breakpoints returned by dbstatus.