[Numpy-discussion] Interface numpy arrays to Matlab?

Neal Becker ndbecker2 at gmail.com
Tue Aug 29 07:08:57 EDT 2017


Transplant sounds interesting, I think I could use this.  I don't
understand though why nobody has used a more direct approach?  Matlab has
their python API
https://www.mathworks.com/help/matlab/matlab-engine-for-python.html.  This
will pass Matlab arrays to/from python as some kind of opaque blob.  I
would guess that inside every Matlab array is a numpy array crying to be
freed - in both cases an array is a block of memory together with shape and
stride information.  So I would hope a direct conversion could be done, at
least via C API if not directly with python numpy API.  But it seems nobody
has done this, so maybe it's not that simple?


On Mon, Aug 28, 2017 at 5:32 PM Gregory Lee <grlee77 at gmail.com> wrote:

> I have not used Transplant, but it sounds fairly similar to
> Python-matlab-bridge.  We currently optionally call Matlab via
> Python-matlab-bridge in some of the the tests for the PyWavelets package.
>
> https://arokem.github.io/python-matlab-bridge/
> https://github.com/arokem/python-matlab-bridge
>
> I would be interested in hearing about the benefits/drawbacks relative to
> Transplant if there is anyone who has used both.
>
>
> On Mon, Aug 28, 2017 at 4:29 PM, CJ Carey <perimosocordiae at gmail.com>
> wrote:
>
>> Looks like Transplant can handle this use-case.
>>
>> Blog post: http://bastibe.de/2015-11-03-matlab-engine-performance.html
>> GitHub link: https://github.com/bastibe/transplant
>>
>> I haven't given it a try myself, but it looks promising.
>>
>> On Mon, Aug 28, 2017 at 4:21 PM, Stephan Hoyer <shoyer at gmail.com> wrote:
>>
>>> If you can use Octave instead of Matlab, I've had a very good experience
>>> with Oct2Py:
>>> https://github.com/blink1073/oct2py
>>>
>>> On Mon, Aug 28, 2017 at 12:20 PM, Neal Becker <ndbecker2 at gmail.com>
>>> wrote:
>>>
>>>> I've searched but haven't found any decent answer.  I need to call
>>>> Matlab from python.  Matlab has a python module for this purpose, but it
>>>> doesn't understand numpy AFAICT.  What solutions are there for efficiently
>>>> interfacing numpy arrays to Matlab?
>>>>
>>>> Thanks,
>>>> Neal
>>>>
>>>> _______________________________________________
>>>> NumPy-Discussion mailing list
>>>> NumPy-Discussion at python.org
>>>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>>>
>>>>
>>>
>>> _______________________________________________
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion at python.org
>>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>>
>>>
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at python.org
>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>
>>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20170829/ac8d5fa6/attachment.html>


More information about the NumPy-Discussion mailing list