How to read a corrupt mat file in reverse?
조회 수: 1 (최근 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
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 Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!