user1257724
user1257724

Reputation:

How do you open .mat files in Octave?

I have a .mat file that I want to open and see its contents. Since I don't have MATLAB, I downloaded GNU's Octave. I'm working on Mac's terminal so I'm not exactly sure how to open the .mat file to see its contents.

How to do this?

Upvotes: 26

Views: 108490

Answers (2)

xealits
xealits

Reputation: 4556

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

variable = load("filename")

Upvotes: 8

Chris A.
Chris A.

Reputation: 6887

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

Upvotes: 33

Related Questions