pure-Go MATLAB file I/O package ?

555 views
Skip to first unread message

Seb Binet

unread,
Jul 7, 2016, 5:27:36 AM7/7/16
to golang-nuts
hi there,

before I go ahead and implement it, has anyone released a pure-Go read/write package for MATLAB files ?


I've found:

but that package is actually using the C-API exposed by a MATLAB installation...

-s

Maxim Khitrov

unread,
Jul 7, 2016, 6:52:49 AM7/7/16
to Seb Binet, golang-nuts
Maybe you already know this, but that PDF seems to cover the format
that was used by MATLAB Version 5 (R8). Versions since R2006b use an
HDF5-based format:

https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html

Unless you only need to work with the old format, you should look for
an HDF5 implementation in Go. I only found bindings for the C library.

-Max

Seb Binet

unread,
Jul 7, 2016, 7:03:15 AM7/7/16
to Maxim Khitrov, golang-nuts
Maxim,

thanks for taking the time to answer me.

On Thu, Jul 7, 2016 at 12:52 PM, Maxim Khitrov <m...@mxcrypt.com> wrote:
Maybe you already know this, but that PDF seems to cover the format
that was used by MATLAB Version 5 (R8). Versions since R2006b use an
HDF5-based format:

https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html

yep. but the data I'll currently need to wrestle with is Level-5.
 


Unless you only need to work with the old format, you should look for
an HDF5 implementation in Go. I only found bindings for the C library.
this one ?
:)
HDF5 is a very VERY large (C) library and reimplementing it in pure-Go would be:
a) a huge task
b) very interesting
c) hair pulling
d) all of the above

the Level-5 (and Level-4) data file format(s) aren't that complicated.
I guess I'll bite the bullet and write the package.

-s

elia.m...@gmail.com

unread,
May 5, 2017, 9:04:58 PM5/5/17
to golang-nuts
Hi Sebastien, I'm writing a program that needs to do the exact same thing you were asking, have you by any chance developed that library? :P

Sebastien Binet

unread,
May 6, 2017, 6:41:59 AM5/6/17
to elia.m...@gmail.com, golang-nuts
Elia,

On Fri, May 5, 2017 at 8:31 PM, <elia.m...@gmail.com> wrote:
Hi Sebastien, I'm writing a program that needs to do the exact same thing you were asking, have you by any chance developed that library? :P

I started it:

but had to put it a bit on the back burner.
it's also a candidate for migration to a hypothetical github.com/gonum/io package...

PRs accepted :)

-s 


On Thursday, 7 July 2016 11:27:36 UTC+2, Sebastien Binet wrote:
hi there,

before I go ahead and implement it, has anyone released a pure-Go read/write package for MATLAB files ?


I've found:

but that package is actually using the C-API exposed by a MATLAB installation...

-s

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

a.ko...@gmail.com

unread,
Nov 3, 2025, 7:41:40 PM (7 days ago) Nov 3
to golang-nuts
Hi! Such a package now exists: **github.com/scigolib/matlab** (v0.1.1-beta)

✅ Pure Go (no CGo)
✅ Read/Write v5-v7.3 formats
✅ All numeric types + complex numbers
✅ 90% test coverage, production tested

```bash
go get github.com/scigolib/matlab@latest
```

Docs: https://github.com/scigolib/matlab

Part of SciGoLib ecosystem. v0.2.0 with v5 writer coming December 2025.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages