开发者

Call MATLAB functions using Python

I have a full functional MATLAB program, and I need to make a Python script where I can call a specific function from the MATLAB program. I am using开发者_运维知识库 Python version 2.7, and I did try to install pymat, but it didn't work for some reason.

I did look into other questions where all recommend pymat, but it is old and not maintained.


I have no personal experience with it, but the project page for mlabwrap seems to indicate it will fit your needs.

From the project page:

Mlabwrap is a high-level python to MATLAB® bridge that lets MATLAB look like a normal Python library.


You can use SAGE which is a Python-based system, and it has an interface to MATLAB.


You might want to use pymatbridge. It's a library that allows you to send variables (for example, NumPy ndarray class instances) between MATLAB and Python. It also has an implementation of a MATLAB 'magic' function for IPython.


I guess the MATLAB officially provided matlab.engine could be the one you want. Refer to "Call User Script and Function from Python" and other instructions on the official website. It runs well for most cases on my ubuntu16.04 with python3.5.2(jupyter-notebook) + MATLAB R2016b.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜