当前位置: 首页 > 工具软件 > vscode-matlab > 使用案例 >

vscode支持matlab吗,整理:VSCode配置Matlab环境,vscodematlab

邓昊天
2023-12-01

整理:VSCode配置Matlab环境,vscodematlab

最简单方法:安装 Matlab Extension Pack。

这个插件里面含有最常用的三个vscode的matlab插件:

1)MATLAB for Visual Studio Code:用于高亮、代码提示、拼写检查等

File>Preferences>User Settings添加:

"matlab.mlintpath":mlint.exe文件路径

(如:"matlab.mlintpath": "C:\\Program Files\\MATLAB\\R2015b\\bin\\win64\\mlint.exe")

"matlab.linterEncoding" : "gb2312"

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

2)MATLAB Runner:用于运行matlab代码

While working on a MATLAB file, highlight the code you want to run, open the command palette to search 'Matlab: Run Selection', and execute the command.

The first time the command is executed it will open a new terminal for matlab which will take a few seconds, but each following execution will be instant.

Selecting 'Matlab: Run File' will run the entire contents of the current file. Make sure you save to see you changes reflected in the output.

简单来说就是:

打开:文件->首选项->设置

在用户文件中填入{

"matlab-runner.matlabPath": "matlab.exe文件的路径",

"matlab-runner.tempFilePath": "新建的.m文件

}

替换设置之后保存。

选择你需要运行的Matlab代码,并运行Matlab: Run Selection命令

3)matlab-formatter: 用于整理规范matlab代码

相关文章暂无相关文章

 类似资料: