Python-created HDF5 dataset transposed in Matlab

前端 未结 3 456
情歌与酒
情歌与酒 2020-12-20 16:04

I have some data that I share between Python and Matlab. I used to do it by saving NumPy arrays in MATLAB-style .mat files but would like to switch to HDF5 datasets. However

3条回答
  •  -上瘾入骨i
    2020-12-20 16:17

    See the Matlab HDF5 documentation which includes the statement:

    Because HDF5 stores data in row-major order and the MATLAB array is organized in column-major order, you should reverse the ordering of the dimension extents ...

    Even today, long after the Mathworks translated their code to C (etc), the product's Fortran origins poke above the surface now and then.

提交回复
热议问题