Skip to content

Conversion from Numpy array to MATLAB double #6

@rebeccafair

Description

@rebeccafair

Using Python 3.8 and MATLAB R2021b on IDAaaS (EL7) I get the following error when trying to convert from a Numpy to MATLAB array:
image

Whereas using Python 3.8 and MATLAB R2021b on my local Windows machine it works fine, and the way the Numpy array is represented seems to be completely different:
image

It seems we can't just tell from the MATLAB version whether double will work or not. There is an alternative py.array.array('d', x) which seems to work, but I don't know how slow it is. We should probably do a try/catch and only if double doesn't work try the other way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions