How to force matlab loading big size v4 .mat file?

조회 수: 8 (최근 30일)
georges trad
georges trad 2016년 6월 2일
댓글: georges trad 2016년 6월 3일
For a mysterious reason, eventhough the specification of the v4 version .mat files (according to http://www.mathworks.com/help/matlab/import_export/mat-file-versions.html) states that Maximum Size of Each Variable is 100,000,000 elements per array, and 2^31 bytes per variable, the piscoscope software saves the data of an acquired channel that can reach up to 1 billion samples in v4 .mat files.
When i try to load such files in matlab (R2015b), naturally i get the following error: Error using load Unable to read MAT-file N:\test.mat. File might be corrupt.
Since i need to process this saved data in matlab, i do the following: In python i load the v4 .mat file using the library scipy and then i resave it as a v5 .mat file Now matlab is able to load this latter file.
Is there a way to avoid all this tedious workaround that is very much time consuming (files ~ 4 GB), and have a way to force matlab loading v4 file format even if it is more than 10^8 samples/ variable?
Or can we do this conversion in matlab it self without having to use other programming languages to do the job?
  댓글 수: 2
John D'Errico
John D'Errico 2016년 6월 2일
I think you are stuck. MATLAB would actually not read or write that file in -v4 format because of the file size. But you are creating it in that form using a different application. So you will need to convert it to a form that MATLAB will read.
georges trad
georges trad 2016년 6월 3일
Thank you John for your answer. Yes, i guess i am stuck. The only way to proceed would be writing a script that would read the .mat file at the binary level following : http://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf and then reformatting the file such as matlab is happy...

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by