vs code 运行matlab代码


title: vs code 运行 matlab 代码
tags: vs code
category: matlab

参考

https://blog.csdn.net/weixin_42815609/article/details/103830253

安装插件

在 vs code 中安装如下插件

Code Runner、Matlab、matlab-formatter

打开配置文件

在配置文件中添加如下代码

"matlab.mlintpath": "D:\\xuexiruanjian\\matlab2020b\\bin\\win64\\mlint.exe",    // 此处路径按需要修改
"matlab.matlabpath": "D:\\xuexiruanjian\\matlab2020b\\bin\\matlab.exe",         // 此处路径按需要修改
"matlab.linterEncoding": "gb2312",
"code-runner.executorMap":{
    "matlab": "cd $dir && matlab -nosplash -nodesktop -r $fileNameWithoutExt",
},
"files.associations": {
    "*.m": "matlab",
},
"[matlab]" : {
    "files.encoding": "gb2312",
},
"files.autoGuessEncoding": true

添加系统变量

搜索 “编辑系统环境变量”,在弹出的窗口中选择 “环境变量”,然后双击 “系统变量” 中的 “path” 变量,然后添加如下路径

需要按情况修改

D:\xuexiruanjian\matlab2020b\bin

运行程序

以 vs code 打开 .m 文件,然后在窗口中 右键,然后选择 “run code”,等待片刻即可运行

本文作者:tiansz

本文链接:https://www.cnblogs.com/tiansz/p/16319556.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   tiansz  阅读(396)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
· 使用C#创建一个MCP客户端
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起