MATLAB: Regarding the “Calling from MATLAB from Python” interface: how would I convert back array data returned from a matlab function as matlab.double()


I would like to refer to the example in the documentation,
In the example the engine returns b, which is a 1-by-5 matlab.double array.
To further process / use that result in python it might be necessary to convert it back to a python list.
Is there a better way to do this than the following, which might be inefficient and complicated for large multidimensional arrays?
b_py = [v for v in b[0]]

Best Answer

  • Try
    it should be much faster.