MAT.jl v0.11 release
After almost 1.5 years since the release of v0.10.7, we have managed to make some big improvements to MAT.jl in v0.11.0.
![]()
Please try it out and report back to us if you find any issues ![]()
Breaking changes
Unfortunately some breaking changes to support better writing:
- Read
MatlabStructArrayinstead of aDict{String,Any}withArray{Any,N}values - Read
MatlabClassObjectinstead of aDict{String,Any}with"class"key
New features
But you gain these wonderful features:
- Write
MatlabStructArray; my personal reason to contribute, see the object array docs for more info - Write
MatlabClassObject; these are old types of MATLAB classes stored in directories like@MyClass - Read
MatlabOpaque; the modern MATLAB classes, with automatic type conversion for:stringtoStringdurationtoDates.MilliseconddatetimetoDates.DateTimecategoricaltoPooledArrays.PooledArraytabletoMatlabTableor tables likeDataFrame
Fixes:
These fixes were mostly dangling unreleased in the master branch:
- MAT v4: handle null-terminator
'\0'in names - Writing
AbstractArraytypes - Writing
Chartype
Example: DataFrame reading
Finally we can read DataFrames! Unless the table columns are ND-arrays instead of vectors, but what kind of monster would do that?
using MAT, DataFrames
filepath = abspath(pkgdir(MAT), "./test/v7.3/struct_table_datetime.mat")
vars = matread(filepath; table = DataFrame)
vars["s"]["testTable"]
# outputs
3Γ5 DataFrame
Row β FlightNum Customer Date Rating Comment
β Float64 String DateTime String String
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β 1261.0 Jones 2016-12-20T00:00:00 Good Flight left on time, not crowded
2 β 547.0 Brown 2016-12-21T00:00:00 Poor Late departure, ran out of dinneβ¦
3 β 3489.0 Smith 2016-12-22T00:00:00 Fair Late, but only by half an hour. β¦
Many credits to the creator of the Python matio package for helping to load the undocumented Matlab Class Object Subsystem (MCOS) in Julia. Now you can finally load modern .mat files that would throw errors or warnings before in v0.10.
We intend to add writing of these MatlabOpaque classes in a next release.
If you have (weird) .mat files, go try out MAT.jl v0.11. Please open Github issues if you find problems, because Iβm sure we missed many corner cases.