This extension provides support for editing MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis, navigation support, and more.
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.
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 soBy 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.