MAT-File Corruption Analysis Tool (MATCAT) version 3, June 2005.
This tool is intended to be run within MATLAB 5 (R8) or later to determine whether a v5 MAT-File is corrupted. Currently only v5 MAT-Files are supported.
Usage example of how to use this function:
given a v5 MAT-File 'myfile.mat' which you want to know whether it is corrupted:
good = matcat('myfile.mat')
0 = failure (bad v5 MAT-File)
1 = success (good v5 MAT-File)
'v5' refers to version 5 of the MAT-File format, not the version of MATLAB itself.
The MAT-File format is documented here:
The version 5 MAT-File format has been in use starting in MATLAB version 5.0 (R8), November 1996, through the present MATLAB version 7 (R14sp2) and later.
>> matcat v5good.mat
MAT-File Corruption Analysis Tool (MATCAT) version 2, February 2005
file 'v5good.mat' opened successfully
numeric data in this MAT-File does not need to be endian-swapped when read on this computer
[MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Tue Feb 8 13:17:27 2005 ]
this MAT-File does not have subsystem data (not all MAT-Files have this)
128 byte v5 MAT-File header ok
variable 1 TAG: datatype_14 (MATRIX), data bytes: 96
variable 2 TAG: datatype_14 (MATRIX), data bytes: 64
variable 3 TAG: datatype_14 (MATRIX), data bytes: 48
MAT-File integrity check completed successfully for (v5good.mat), 3 variable(s) found
John Aspinall (2021). MATCAT - MAT-File Corruption Analysis Tool (https://www.mathworks.com/matlabcentral/fileexchange/6893-matcat-mat-file-corruption-analysis-tool), MATLAB Central File Exchange. Retrieved .
Well I'm trying to use it to find out why my file is corrupt and not opening, but it validates it as a good file. I'm trying to write an array of miSINGLE values with C++ and its not working. I was hoping this tool would tell me why. It also says the Header is invalid on good files when it does not begin with MATLAB, however the matfile format documentation says the header can contain anything (just make sure you use the first 4 bytes). We use our company name first. I don't so much need a validator to tell me a file is good. It will open.
Well I'm trying to use it to find out why my file is corrupt and not opening, but it validates it as a good file. I'm trying to write an array of miSINGLE values with C++ and its not working. I was hoping this tool would tell me why.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!