python中调用matlab的模型_从python调用MATLAB函数

1586010002-jmsa.png

Is it possible to run MATLAB functions from within Python?

I search the internet, I could only find PyMat. The bad thing is the compiled version only supports Python2.2 and I am using 2.6. So I tried to download the source code, so I can compile it for myself. But I cannot compile it, VC++ express seems not to have the necessary functionalities to compile it. Does anyone have the compile version for PC?

or any substitutes for PyMat?

Thanks

解决方案

PyMat looks like it's been abandoned.

I'm assuming you are on windows so you could always do the simplest approach and use Matlab's COM interface:

>>> import win32com.client

>>> h = win32com.client.Dispatch('matlab.application')

>>> h.Execute ("plot([0 18], [7 23])")

>>> h.Execute ("1+1")

u'\nans =\n\n 2\n\n'

More info here

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值