MATLAB调用python,交互

本文介绍了如何在MATLAB中调用Python,包括配置路径、解决调用numpy和cv2时的问题,以及MATLAB与Python之间的数据传递方法。在调用Python时,可能遇到显示cv2窗口和plt的问题,解决方案包括在Anaconda Prompt中打开MATLAB或使用pyinstaller将py脚本转为exe。MATLAB会将数据自动转换为Python的memoryview对象,建议使用double或logical进行转换。
摘要由CSDN通过智能技术生成

MATLAB调用python

1. 先配置 路径

2. 在调用 numpy cv2时,经常会出现问题

Solutions: open matlab in Anaconda Prompt, as shown in the following Figure.
this solution is inspired by https://blog.csdn.net/Yana_Zeng/article/details/103574555

在这里插入图片描述

3. my first py script called by matlab, shown as below

however , it always gets error when showing cv2 windows and plt.
it still can not show the window,

maybe I can convert the py script to exe file by pyinstaller as the following blog does: https://blog.csdn.net/qq_27280237/article/details/81561898


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值