You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a v7.3 file in MATLAB with a variable x = zeros([3,4,5]), and then I look at it in HDFView, it shows that it's stored in the HDF5 file with dimensions 5x4x3. So hdf5storage should not reverse the dimension order when saving to MATLAB-compatible files.
The text was updated successfully, but these errors were encountered:
Matlab uses Fortran ordering for indices but stores dimensions in v7.3 MAT files with C ordered dimensions with the order of elements in memory being preserved (flat iterator).
When deciding how to implement the matlab compatibility, there was a choice to make between having arrays have the same order in memory for both Python and Matlab or to make the array look the same in each with each's individual indexing (what is in the same row in Python is in the same row in Matlab).
I chose the latter, which means a 2x5 array in Python ends up being a 2x5 array in Matlab, though the ordering in memory is different due to the required transpose to do this.
I realize now that the way I wrote the package wrongly forces the one choice on the user. I think a good solution is to make the matlab_compatible not be a True/False flag but instead have three possible values, one for each of these choices and one for no matlab compatibility (would stay False); with True mapping to the current forced choice to maintain backwards compatibility. I will try to implement this soon and make a new release that adds this to the 0.1.x line and the master branch (it won't break compatibility so it can be safely added).
Thank you for bringing this oversight to my attention.
If I create a v7.3 file in MATLAB with a variable x = zeros([3,4,5]), and then I look at it in HDFView, it shows that it's stored in the HDF5 file with dimensions 5x4x3. So hdf5storage should not reverse the dimension order when saving to MATLAB-compatible files.
The text was updated successfully, but these errors were encountered: