Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract .mat data without matlab - tried scilab unsuccessfully

Tags:

matlab

scilab

I've downloaded a data set that I am interested in. However, it is in .mat format and I do not have access to Matlab.

I've done some googling and it says I can open it in SciLab.

I tried a few things, but I haven't found any good tutorials on this.

I did

fd = matfile_open("file.mat")

matfile_listvar(fd)

and that prints out the filename without the extension. I tried

var1 = matfile_varreadnext(fd)

and that just gives me "var1 = "

I don't really know how the data is organized. The repository described the data it contains, but not how it is organized.

So, my question is, what am I doing wrong in extracting/viewing this data? I'm not committed to SciLab, if there is a better tool for this I am open to that.

like image 282
Nate Avatar asked Nov 11 '11 20:11

Nate


People also ask

How do I open a .MAT file without MATLAB?

It is not possible to open it with a text editor (except you have a special plugin as Dennis Jaheruddin says). Otherwise you will have to convert it into a text file (csv for example) with a script. This could be done by python for example: Read . mat files in Python.

How do I retrieve data from a .MAT file?

You could use the "load" command to read data stored in a MAT file. The "dlmread" function is used for reading ASCII delimited file.

What can open .MAT files?

MATLAB from MathWorks can open MAT files that are used by that program.


2 Answers

One options is to use Octave, which can read .mat files and run most Matlab .m files. Octave is open source with binaries available for Linux, Mac, and Windows. Inside of Octave you can load the file using:

load file

See Octave's manual section 14.1.3 Simple File I/O for more details.

like image 183
Richard Povinelli Avatar answered Nov 05 '22 01:11

Richard Povinelli


In Scilab:

loadmatfile('file.mat');

(Source)

like image 35
ashu Avatar answered Nov 05 '22 00:11

ashu