20211110_在jupyter notebook中编写MATLAB代码

1、安装jupyter notebook

2、安装用于Python的MATLAB引擎

Python 版本支持

前往https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/python-compatibility.pdf查阅两者相互兼容的版本

在命令行窗口执行python -V以确定Python版本

Python架构

Python必须是64位。执行以下代码,返回True则Python是64位

import sys
print(sys.maxsize > 2**32)

安装用于 Python 的 MATLAB 引擎 API

方法一:

启动MATLAB,在命令行窗口输入matlabroot,得到MATLAB安装根目录dir

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uxJIZcbO-1636636070190)(assets/20211110_在jupyter notebook中编写MATLAB代码/image-20211110145049702.png)]

进入"dir\extern\engines\python",启动命令行,执行以下代码

python setup.py install

方法二:

在MATLAB命令行窗口执行

cd (fullfile(matlabroot,'extern','engines','python'))
system('python setup.py install')

其他操作可参考官网教程https://ww2.mathworks.cn/help/matlab/matlab_external/install-the-matlab-engine-for-python.html#mw_0ef1183c-9518-47df-81a4-872435eb468f

3、安装用于jupyter的MATLAB内核

参考https://github.com/Calysto/matlab_kernel

pip install matlab_kernel
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值