How do you open .mat files in Octave?

不打扰是莪最后的温柔 提交于 2019-11-29 12:00:57

问题


I have a ".mat" file that I want to open and see the contents of. Since I don't have MATLAB, I downloaded GNU's Octave. Since I'm working on Mac's TERMINAL, I'm not exactly sure how to open the ".mat" file so that I can see the contents. Can anyone help me with this? Thanks!


回答1:


Not sure which version of .mat file you might have, or whether Octave keeps up with the latest Matlab formats.

Here's a link that might be a good start.

Bottom line is that you can say: load MyMatFile.mat right at the Octave prompt.

In case you wind up having to write code to read the .mat file ever: I've done this before and it was not difficult, but was time-consuming. Mat file format for 2012a




回答2:


If your file contains only numbers, no .mat header, then this should work:

variable = load("filename")


来源:https://stackoverflow.com/questions/9915658/how-do-you-open-mat-files-in-octave

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!