英文:
Is it possible to read .mat files in Go?
问题
我想使用Go加载一个存储有4个字段的1x1结构的MATLAB文件。我还没有找到与Python的SciPy相似的东西,它有一个"loadmat"函数。在Go中读取.mat文件的最佳方法是什么?
英文:
I'd like to load a MATLAB file that stores a 1x1 struct with 4 fields using Go. I haven't found anything comparable to Python's SciPy which has a "loadmat" function. What is the best way to read .mat files in Go?
答案1
得分: 5
你可能需要编写自己的Go包。MathWorks建议你使用他们的MATLAB MAT文件C API进行接口。在Go中使用cgo来实现这一点。
参考资料:
MATLAB MAT-File Format - MathWorks
英文:
You may have to write your own Go package. MathWorks suggests that you interface with their MATLAB MAT-file C API. To do that in Go, use cgo.
References:
答案2
得分: 1
不,目前似乎没有纯Go语言的用于读取MalLab文件的项目(在CGo中有,参见PeterSO的答案):
- go-search没有列出任何相关的项目
- GitHub上也没有相关项目
- Libraries list中也没有包含任何相关内容
此外,在“Go矩阵库”中也提到了性能考虑。讨论更多关于从Matlab调用Go的问题。
英文:
No, there doesn't seem to be any project for reading MalLab files in pure Go (in CGo, see PeterSO's answer):
- go-search doesn't list any relevant project
- GitHub doesn't have any either.
- the Libraries list doesn't include any
And, there were performance consideration as well, mentioned in "Go matrix library".
The discussion was more about calling go from Matlab.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论