概述
最简单方法:安装 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代码
In settings, find 'matlab-runner.matlabPath' and set it to the location of the matlab executable. For example (mac): '/Applications/MATLAB_R2017b/bin/matlab'
Create an empty matlab file ('something'.m) and save it
In settings, find 'matlab-runner.tempFilePath' and set it to the location of the file you just created. For example (mac): '/Users/username/Documents/temp.m'
The setting 'matlab-runner.clearPastRuns' is a true or false value (defaults to true) that indicates whether or not the previous output should be cleared from the terminal window upon a following execution.
The setting 'matlab-runner.powershell' is a true or flase value (defaults to false) that indicates whether or not matlab is being executed in powershell
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代码
最后
以上就是拉长毛巾为你收集整理的matlab的vs的环境,整理:VSCode配置Matlab环境的全部内容,希望文章能够帮你解决matlab的vs的环境,整理:VSCode配置Matlab环境所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复