VSCode Using Notes

How to add “Program Files” in VS Code settings

Use "C:\Program Files\..." or C:\"Program Files"\...

How to write MATLAB scripts in VSCode

However, I find it not a good idea. The terminal crashes from time to time and Workspace in MATLAB cannot be integrated into vscode.

The main reason I want to use vscode to write MATLAB scripts is darkmode and suggestions. By changing the color profile and enabling autocompletion in MATLAB preferences, I can get a similar result.

Install Extensions

1
2
3
4
5
6
7
8
9
10
11
12
13
Matlab # highlighting, suggestions, error messages
# You need to set matlab path and mlint path in the extension settings page.

matlab-formatter # format things
# You need to set Python path in the extension settings page.

Matlab Interactive Terminal # use vscode terminal instead of matlab IDE
# You need to set Python path in the extension settings page.
# If you enable this extension, do not enable another extension 'matlab-code-run'

Matlab Snippets # more advanced suggestions

Matlab Code Run # run matlab using ctrl+shift+p and choose 'run current matlab script or open a matlab terminal'

Install MATLAB API for Python

The extension Matlab Interactive Terminal is based on matlab api for python. Follow this doc to install matlab api for python.

In Windows, cd matlabRootPath\extern\engines\python, then python setup.py install.