【问题标题】:Is it possible to read .mat files in Go?是否可以在 Go 中读取 .mat 文件?
【发布时间】:2014-12-20 08:32:59
【问题描述】:

我想使用 Go 加载一个 MATLAB 文件,该文件存储一个具有 4 个字段的 1x1 结构。我还没有找到与 Python 的 SciPy 相比的任何东西,它具有“loadmat”函数。在 Go 中读取 .mat 文件的最佳方法是什么?

【问题讨论】:

    标签: go mat-file


    【解决方案1】:

    您可能需要编写自己的 Go 包。 MathWorks 建议您使用他们的 MATLAB MAT 文件 C API 接口。要在 Go 中执行此操作,请使用 cgo。

    参考资料:

    MATLAB MAT-File Format - MathWorks

    Command cgo

    C? Go? Cgo!

    【讨论】:

      【解决方案2】:

      不,似乎没有任何项目可以在纯 Go 中读取 MalLab 文件(在 CGo 中,请参阅 PeterSOanswer):

      而且,还有性能方面的考虑,在“Go matrix library”中提到。
      discussion was more about calling go from Matlab

      【讨论】:

        猜你喜欢
        • 2010-11-12
        • 2013-06-23
        • 2014-11-27
        • 2022-01-01
        • 1970-01-01
        • 2011-06-29
        • 1970-01-01
        • 1970-01-01
        • 2018-07-04
        相关资源
        最近更新 更多