Can not read MAT file in another language
2 次查看(过去 30 天)
显示 更早的评论
I have two MAT files. I can open A but can not open B in Julia.
When I used the command “@show(File)”. I got the below for File A:
F1 = MAT.MAT_HDF5.MatlabHDF5File(HDF5.File: (read-only) /Volumes/A.mat, true, false, 1108, false)
but the below for File B:
F2 = MAT.MAT_v5.Matlabv5File(IOStream(<file /Volumes/B.mat>), false, undef)
File A was created by someone I do not know, and File B was created by myself using the command below:
save(File_W, ‘Variable1’, ‘Variable2’);
I can open File B in Matlab easily. What is wrong with my file B? Is that because it is a special type of MAT file, i.e., HDF5? How do I create HDF5 flavored MAT files to make it more versatile? Thanks.
0 个评论
采纳的回答
John D'Errico
2025-6-26
My guess is Julia can read a .mat file created for an earlier release of MATLAB. Looking at the help for save, you can specify a different save format, able to be read into an earlier MATLAB release.
The default is "-v7" as you can see from the help. But you might try "-v6", or "-v4".
help save
3 个评论
John D'Errico
2025-6-26
I was pretty sure it was a choice of save version. It just went the other way.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 HDF5 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!