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

3 views (last 30 days)
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 Comments
John D'Errico
John D'Errico on 2 Jun 2016
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 on 3 Jun 2016
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...

Sign in to comment.

Answers (0)

Categories

Find more on Large Files and Big Data in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!