Writing of (compressed) v5 MAT file with MATLAB Class Object Subsytem (MCOS)
After fixing #40 I noticed that writing of MAT files with MCOS results in MAT files that MATLAB cannot open though it looks good in matio.
Dump variables of original bugv6.mat MAT file (saved by MATLAB). The trailing UINT8 variable without a name is the MCOS data.
$ matdump -f whos bugv6.mat
Name Size Bytes Class
la 1x7 7306 mxSTRUCT_CLASS
1x88 88 mxUINT8_CLASS
Copy bugv6.mat to copy6.mat.
$ test_mat copy -v 5 bugv6.mat -o copy6.mat
Dump gives same output again.
$ matdump -f whos copy6.mat
Name Size Bytes Class
la 1x7 7306 mxSTRUCT_CLASS
1x88 88 mxUINT8_CLASS
However, MATLAB fails
>> load copy6.mat
??? Error using ==> load
Can't read file d:\temp\copy6.mat.
There has been significant reverse engineering work on MCOS by @mbauman and published at http://nbviewer.jupyter.org/gist/mbauman/9121961. Currently, I would be happy to know why copy6.mat is not as expected and what can be worked around to make it a valid MAT file again.
In case of compressed v5 MAT files the write problem is more apparent
$ test_mat copy -v 5 -z bugv7.mat -o copy7.mat
-E- : fields[1], Uncompressed type not MAT_T_MATRIX
-E- : fields[2], Uncompressed type not MAT_T_MATRIX
-E- : fields[3], Uncompressed type not MAT_T_MATRIX
-E- : fields[4], Uncompressed type not MAT_T_MATRIX
-E- : fields[5], Uncompressed type not MAT_T_MATRIX
-E- : fields[6], Uncompressed type not MAT_T_MATRIX
-E- : fields[12], Uncompressed type not MAT_T_MATRIX
-E- : fields[13], Uncompressed type not MAT_T_MATRIX
-E- : fields[14], Uncompressed type not MAT_T_MATRIX
-E- : fields[15], Uncompressed type not MAT_T_MATRIX
-E- : fields[16], Uncompressed type not MAT_T_MATRIX
-E- : fields[17], Uncompressed type not MAT_T_MATRIX
-E- : fields[18], Uncompressed type not MAT_T_MATRIX
-E- : fields[19], Uncompressed type not MAT_T_MATRIX
-E- : fields[20], Uncompressed type not MAT_T_MATRIX
Files are availabe from issue47.zip.
check this PR in MAT.jl, they figured out the structure of MCOS, and support Matlab opaque class
Thanks for the link. It's been reverse-engineered for some years. Still a lot of work.