Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing of (compressed) v5 MAT file with MATLAB Class Object Subsytem (MCOS) #47

Open
tbeu opened this issue Oct 19, 2016 · 0 comments
Open

Comments

@tbeu
Copy link
Owner

tbeu commented Oct 19, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant