Menu

Read and Write MATLAB .mat Files in Go Without CGO: Files That Read as Empty, and MATLAB Files We Couldn't Open
📰

Read and Write MATLAB .mat Files in Go Without CGO: Files That Read as Empty, and MATLAB Files We Couldn't Open

DEV Community: datascience·Andrey Kolkov·5 days ago
#cbyH6ZA2
#devtodatascience#science#devto#dev#matlab
Reading 0:00
15s threshold

The previous article was about scigolib/hdf5 , a pure Go HDF5 library born out of the need to read MATLAB data in Go. This is the other half of that story: scigolib/matlab , the library that actually reads the .mat files.

It reads and writes both MATLAB formats in pure Go, with no cgo:

v5 (MATLAB v5 to v7.2): the classic binary format, including the zlib-compressed elements MATLAB writes by default;

v7.3 : HDF5 underneath, through scigolib/hdf5.

What works today: every numeric class, complex numbers, multi-dimensional arrays, reading char arrays, both byte orders, 32-bit targets in CI, and a fuzz-tested v5 parser.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.