vscode-matlab

MATLAB support for Visual Studio Code
授权协议 MIT License
开发语言
所属分类 应用工具、 科研计算工具
软件类型 开源软件
地区 不详
投 递 者 刘博文
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

MATLAB for Visual Studio Code

This extension adds language support for MATLAB to Visual Studio Code.

Main features

Colorization

(imported from MathWorks TextMate grammar)

Snippets

(Translated from TextMate's snippets)

Code Checking

Uses mlint for checking the MATLAB code for problems on save.

Usage

Install the extension in VS Code

  • Open the command palette using Ctrl+Shift+P
  • Type ext install Matlab in the command palette

Select MATLAB as a language

  • On the bottom-right corner, click on the select language mode button, if you have created a new file it should display Plain Text
  • Select MATLAB in the list of languages.

Alternatively, saving the file with a .m extension, will allow VS Code to understand that it is a MATLAB file, and automatically select the language correctly.

Using snippets

  • Bring-up the autocomplete menu by hitting the Ctrl+Shift key combination
  • Select the snippet that you want to use in the list
  • Use tab to navigate through the snippet's variables

Setting-up linter

  • Open the User Settings by going to File>Preferences>User Settings

  • On the right pane, where you have the settings.json file open, add to the json file.

    "matlab.mlintpath" : "path to your mlint.exe file"

    For example, on a PC :

    "matlab.mlintpath": "C:\\Program Files (x86)\\MATLAB\\R2012a\\bin\\win32\\mlint.exe"

    And on a Mac :

    "matlab.mlintpath": "/Applications/MATLAB_R2016a.app/bin/maci64/mlint"

  • Save your settings.json file

  • Now, when you open a Matlab document (.m), VS Code displays warnings and errors.

    Remark: If you don't want the lint on save option and you want to remove the error message being displayed when the extension activates, change the matlab.lintOnSave option in the settings file to False.

Setting the linter configuration

By adding "matlab.linterConfig" : "path-to-linter-config-file" to your VSCode configuration file, you can pass a configuration file to the mlint call. Check Matlab's documentation to create this configuration file.

Setting the linter encoding

For some languages, like Chinese, the return of the linter is not using the default utf-8 encoding, but a different encoding (gb2312 for Chinese). If the linting doesn't show correctly, change the matlab.linterEncoding to the encoding used by your Windows console. For example, if your Windows is installed in Chinese, add "matlab.linterEncoding" : "gb2312" to your settings.json.

Changing the default file association

Visual Studio Code's default file association for .m files is Objective-C, if you want to set up the default file association to be Matlab go to the Users preference (File>Preferences>User Settings) and add the following line:

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

Changing the default file encoding

MATLAB default file encoding is not utf-8, but Visual Studio Code is using utf-8 as default. The following setting specifies the default encoding for MATLAB files in Visual Studio Code:

"[matlab]": { "files.encoding": "windows1252" }
  • 前面有两篇文章我们分别讲了在vscode里面如何配置C语言环境和python环境,那两篇文章总体来说比较复杂,当然这篇也有许多有趣的问题。 附上链接: matlab简介 MATLAB是美国MathWorks公司出品的商业数学软件,用于数据分析、无线通信、深度学习、图像处理与计算机视觉、信号处理、量化金融与风险管理、机器人,控制系统等领域。 MATLAB是matrix&laboratory两个词的组

  • 整理:VSCode配置Matlab环境,vscodematlab 最简单方法:安装 Matlab Extension Pack。 这个插件里面含有最常用的三个vscode的matlab插件: 1)MATLAB for Visual Studio Code:用于高亮、代码提示、拼写检查等 File>Preferences>User Settings添加: "matlab.mlintpath":mli

  • vscode编写Matlab代码文本,着色补全,参考: https://www.cnblogs.com/gc-blog/p/13592076.html 主要是Ubuntu的相应路径说明文档都没给路径,后来找了一下,加到settings.json "matlab.mlintpath": "/usr/local/MATLAB/R2018b/bin/glnxa64/mlint", "matlab.mat

 相关资料
  • Visual Studio Code - Open Source ("Code - OSS") The Repository This repository ("Code - OSS") is where we (Microsoft) develop the Visual Studio Code product together with the community. Not only do we

  • ES6 创建 tsconfig.json tsc --init { "compilerOptions": { "module": "commonjs", /* 用来指定要使用的模块标准: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "target": "es6" /* targe

  • Visual Studio Code 扩展 Beautify:Beautify code in place for VS Code ESLint:Integrates ESLint into VS Code Material Theme:Maybe the best theme on VS Code vscode-icons:Icons for Visual Studio Code Emmet:

  • VSCode Neovim 是将 Neovim 集成到 VSCode 的插件,该插件将 Neovim 实例完全嵌入到 VSCode,而非半成品的 VIM 模拟。此外 VSCode 原生功能被用于插入模式和编辑器命令。 主要特性 通过使用 Neovim 作为后端,几乎完全集成了功能完整的 VIM 支持自定义init.vim和许多 VIM 插件 “一等公民”支持且无延迟的插入模式,让 VSCode 做

  • rls-vscode 是 Rust 官方为 Visual Studio Code 提供的 Rust 语言服务器前端参考实现,它支持: 代码补全 jump to definition、peek definition、find all references 与 symbol search 类型和文档悬停提示 代码格式化 重构 错误纠正并应用建议 snippets 构建任务 值得一提的是 snippet

  • vscode-drawio 是一个 VS Code 扩展,它可以在 VS Code 上集成图表工具 Draw.io。 特性: 在 Draw.io 编辑器或者 XML 文件编辑 .drawio 和 .dio 文件。 编辑嵌入许多 Draw.io 图表的 .drawio.svg 文件。 创建简单。 .drawio.svg 是有效的 .svg 文件。 默认情况下使用 Draw.io 的离线版本。 可以配