This is a VSCode extension for Matlab. It provides the following features:
- run a complete matlab .m file
- run a cell in matlab code by press
ctrl+enter
orcmd+enter
- interrupt matlab process by clicking the stop button
- change the work directory of matlab to the directory of the current file
- open the workspace of matlab to inspect the variables
- open the current file in matlab editor for debugging or other purpose
All functions can be accessed by clicking the button in the menu bar. If matlab terminal is not started, the extension will start it automatically. Then, you need to reclick the button to run the command.
Click here to install the extension.
-
matlabPybackend
: It is recommended to use the python backend in Windows. Check this link for installing MATLAB Engine API for Python. -
matlabCMD
: The command to start the Matlab terminal, default ismatlab -nodesktop -nosplash
. If the python backend is used, it will be ignored. In Windows, if you do not want to use the python backend, you can set it tomatlab -nojvm
to run code in the terminal. However, in this case, any function related to gui will not work. -
matlabStartup
: the code to run after starting the matlab, default is empty, you can add some code to set the default figure style, for example:"matlab-in-vscode.matlabStartup": [ "addpath(genpath('./'));", "set(groot, 'defaultLineLineWidth', 2);", "set(groot, 'DefaultLineMarkerSize', 8);", "set(groot, 'defaultAxesFontSize', 18);", "set(groot, 'defaultAxesXGrid', 'on');", "set(groot, 'defaultAxesYGrid', 'on');", "set(groot, 'defaultAxesBox', 'on');", "set(groot, 'defaultLegendBox', 'off');", "format compact;" ],
You can split your code by %%
, click the run cell button or simply press ctrl+enter
(mac: cmd+enter
) to run the active cell.
If matlab terminal is not started, the extension will start it automatically.
Add matlab python engine support.
Rename the properties, and add the property that used to start the matlab terminal.
Add split line for each cell. Add a button to open the help document of matlab.
Fix keybinding issue.
Add an icon for the extension.
First release!!!