MATLAB-extension-for-vscode
MATLAB-extension-for-vscode copied to clipboard
Add breakpoints using dbstop
I have been experimenting with a workflow which involves editing MATLAB files using vs code, then running them by calling the script through an open MATLAB command window (separate from vs code).
Suppose you have a MATLAB script. You can add a breakpoint by using dbstop
, like so
By running the script through the MATLAB command window, I get
Which creates a debug point here
I feel like there could be functionality to add breakpoints this way (for now). Perhaps adding a breakpoint in vs code could automatically add the line dbstop at [line number add 1] in [current file]
I know there is work to integrate MATLAB debugging in vs code, but this could be a simple workaround for now.
Edit: Apparently, the keyboard
command may work better in this case. I have never tried this, but it could be a preferable alternative to the clunky dbstop line. Still, something to bind the add/remove debug point shortcut to this command would be great.