MAT.jl already supports compression when reading mat files. This pull request implements compression in write mode, that Matlab/Octave supports (MATLAB v7.3 format). Here is a sample usage
# create a big matrix that compresses well
A = zeros(1000,1000); A[4,5] = 1; A[999,3]=1;
# uncompressed
f=matopen("toto.mat","w"); write(f,"A",A); close(f)
# compressed
f=matopen("totoz.mat","wz"); write(f,"A",A); close(f)
# compare
f=matopen("totoz.mat"); B=read(f,"A"); close(f)
norm(vec(A-B),Inf)
Enabling compression reduces size from 8MB to 5k in this (contrived) example.
MAT.jl already supports compression when reading mat files. This pull request implements compression in write mode, that Matlab/Octave supports (MATLAB v7.3 format). Here is a sample usage
Enabling compression reduces size from 8MB to 5k in this (contrived) example.
Some other details: