How to read a corrupt mat file in reverse?

3 次查看(过去 30 天)
For the first time in 15 years of using matlab I ran into the issue today of not being able to open a mat file.
Following the solutions proposed in this answer (https://www.mathworks.com/matlabcentral/answers/98890-how-do-i-recover-data-from-a-corrupt-mat-file) I was able to recover the first seven variables from the mat file using splitmat.m, but I'm unable to load the 50+ others which took me over a day to create.
I'm able to read the same content (first 7 variables) from the corrupt file using...
whos -file corruptMATFileName
...but I get an error when trying to load any variable (whether recognized with the command aboe or not) using the specific variable name:
load('<corrupted_file>.mat', '<uncorrupted_variable>');
Therefore my questions: is it possible to load a mat file in reverse (reading the bottom variables first) or any other way in order to skip the faulty part of the mat file?
Kind regards,
Florian
  3 个评论
Florian
Florian 2020-5-11
Unfortunately the link does not provide any solution to my problem.
dpb
dpb 2020-5-11
Directly, no. I don't think there is any canned solution you'll find, though. The link shows using low-level access to the content...
Of course, you can also just retrieve bytes directly from the .mat file and reconstruct if you can find the location of the data. If it is compressed, then that's not directly helpful, either, unfortunately.
I suspect you'll be forced to recreate the data, unfortunately, or the solution otherwise may take as long to research/develop code to extract the data as going on would -- without, the knowledge of what level of success might have.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by