tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
330 stars 97 forks source link

My mat file version is v7.0. Can savemat set this version number?Thank you. #154

Closed Qianzujin closed 3 years ago

Qianzujin commented 3 years ago

My mat file version is v7.0. Can savemat set this version number?Thank you.

tbeu commented 3 years ago

How did you create it?

Qianzujin commented 3 years ago

-4ca7e7e8a28e8d7f.jpg There are three options on the picture. I can only save the options above and below through the matio library. I can't save the options of version 7.0 in the middle. If you have any methods, please let me know. Thank you very much!

tbeu commented 3 years ago

Duplicate of https://sourceforge.net/p/matio/discussion/609377/thread/28532fb664/#0605, but I agree, the versioning is confusing.

Qianzujin commented 3 years ago

I have read the article and tried to compress the mat file when saving it. But the mat file generated by Matlab is not exactly the same, so there is no way for the matio library to generate the - V7 version of the mat file? There are other ways, I am not very clear, if there is a way, please tell me, thank you very much.

Qianzujin commented 3 years ago

My English is not very good, is through the translation program translation, if I said is difficult to understand, I am very sorry about this...

tbeu commented 3 years ago

Here is the table of matio create/write options along with the corresponding MATLAB save options.

Create file by Mat_CreateVer Write variables by Mat_VarWrite Corresponding MATLAB save options
mat_file_ver = MAT_FT_MAT4 compress = MAT_COMPRESSION_NONE -v4
mat_file_ver = MAT_FT_MAT5 compress = MAT_COMPRESSION_NONE -v6
mat_file_ver = MAT_FT_MAT5 compress = MAT_COMPRESSION_ZLIB -v7
mat_file_ver = MAT_FT_MAT73 compress = MAT_COMPRESSION_NONE -v7.3 -nocompression
mat_file_ver = MAT_FT_MAT73 compress = MAT_COMPRESSION_ZLIB -v7.3
Qianzujin commented 3 years ago

Thank you very much for your detailed answers, but I have tried these saving options, and there are still some differences between MATLAB native mat files and them. I will think of other ways to solve the problem, thank you very much again!