VSCode配置matlab编译环境

需要安装Matlab相关插件,并对setting.json文件进行配置。

setting.json文件的{}中加入如下配置代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/***********************************
* 下面为matlab编译环境配置
***********************************/

"matlab.mlintpath": "D:\\MATLAB\\bin\\win64\\mlint.exe",
"matlab.matlabpath": "D:\\MATLAB\\bin\\matlab.exe",
"matlab.linterEncoding": "gb2312",

"code-runner.executorMap": {
"matlab":"cd $dir && matlab -nosplash -nodesktop -r $fileNameWithoutExt",
},

"files.associations": {
"*.m":"matlab",
},

"code-runner.runInTerminal": true,

"[matlab]": {
"files.encoding": "gb2312",
},

"files.autoGuessEncoding": true,
"workbench.colorTheme": "One Dark Pro Darker",
"workbench.iconTheme": "vscode-icons",
"search.smartCase": true,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"files.autoSave": "afterDelay",
"terminal.integrated.commandsToSkipShell": [
"language-julia.interrupt"
],
"julia.symbolCacheDownload": true,
"tabnine.experimentalAutoImports": true,
"vsicons.dontShowNewVersionMessage": true,
"editor.fontFamily": "Cascadia Code, 'Courier New', monospace",
"security.workspace.trust.enabled": false,
"editor.fontSize": 13,

需要注意 matlab.mlintpath 和 matlab.matlabpath 的地址是否能够和自己MATLAB安装后对应的子程序的地址相匹配。否则无法在VSCode中运行matlab代码。