MAT

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Merged content from Mat-file entry (which can now be removed))
Line 1: Line 1:
 
{{FormatInfo
 
{{FormatInfo
 
|formattype=electronic
 
|formattype=electronic
|subcat=Scientific Data formats
+
|thiscat=Scientific Data formats
 
|extensions={{ext|mat}}
 
|extensions={{ext|mat}}
 +
|mimetypes={{mimetype|application/x-matlab-data}}
 
}}
 
}}
  
==Overview==
+
'''MAT''' is a format used by Mathworks' [[Matlab]] for storing formatted data (matrices, structs, scalars and strings).  
A binary format used by numerical computing environment Matlab to store matrices, structs, scalars and strings. Also supported by Mathematica.
+
  
Scientific computing packages [http://numpy.scipy.org/ NumPy and SciPy] enable support for MAT-files in [[Python]].
+
Apart from Matlab, the format is also supported by Mathematica. [https://www.gnu.org/software/octave/ GNU Octave], an open source alternative to Matlab, should be able to read and write the format as well. Scientific computing packages [http://numpy.scipy.org/ NumPy and SciPy] enable support for MAT-files in [[Python]].
  
==References==
+
== Versions ==
* MAT-File Format [http://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf here]
+
The [http://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf published specification] makes a distinction between Level 4 and Level 5 MAT-files, where Level 4 files are compatible with older MATLAB versions (up to version 4), whereas level 5 files are compatible with MATLAB versions 5 and higher. The overall layout of a Level 4 file is quite different from Level 5, and the two might even be considered separate formats. For example, Level 4 files don't have a unique 'magic' byte pattern that would allow easy identification, whereas the header of a Level 5 file includes a descriptive text field that could be used for this.
 +
 
 +
[[Matlab_figure]] files are really just a special case of the level 5 MAT-File format.
 +
 
 +
== Identification ==
 +
Level 5 files begin with the text string <code>MATLAB 5.0 MAT-file</code>. No such unique pattern exists for level 4. The MIME type of this format is unofficial, and it is used by [[Apache Tika]]
 +
 
 +
== Specification ==
 +
* [http://www.mathworks.com/help/pdf_doc/matlab/matfile_format.pdf MAT-File Format Specification]
 +
 
 +
== Software ==
 +
* [http://www.mathworks.com/matlabcentral/fileexchange/6893-matcat-mat-file-corruption-analysis-tool MATCAT - MAT-File Corruption Analysis Tool] (requires MATLAB)
 +
 
 +
== Links ==
 +
* [http://stackoverflow.com/questions/3947549/what-is-the-difference-between-m-and-mat-files-in-matlab What is the difference between .m and .mat files in MATLAB]
 +
* [http://www.mathworks.com/help/matlab/import_export/mat-file-versions.html MAT file versions]
 +
* [http://en.wikibooks.org/wiki/Octave_Programming_Tutorial/Saving_and_loading_a_MAT-file Saving and loading a MAT-file in GNU Octave]
 
* Writing Custom Applications to Read and Write MAT-Files [http://www.mathworks.se/help/matlab/matlab_external/custom-applications-to-read-and-write-mat-files.html here]
 
* Writing Custom Applications to Read and Write MAT-Files [http://www.mathworks.se/help/matlab/matlab_external/custom-applications-to-read-and-write-mat-files.html here]

Revision as of 10:56, 27 October 2014

File Format
Name MAT
Ontology
Extension(s) .mat
MIME Type(s) application/x-matlab-data

MAT is a format used by Mathworks' Matlab for storing formatted data (matrices, structs, scalars and strings).

Apart from Matlab, the format is also supported by Mathematica. GNU Octave, an open source alternative to Matlab, should be able to read and write the format as well. Scientific computing packages NumPy and SciPy enable support for MAT-files in Python.

Contents

Versions

The published specification makes a distinction between Level 4 and Level 5 MAT-files, where Level 4 files are compatible with older MATLAB versions (up to version 4), whereas level 5 files are compatible with MATLAB versions 5 and higher. The overall layout of a Level 4 file is quite different from Level 5, and the two might even be considered separate formats. For example, Level 4 files don't have a unique 'magic' byte pattern that would allow easy identification, whereas the header of a Level 5 file includes a descriptive text field that could be used for this.

Matlab_figure files are really just a special case of the level 5 MAT-File format.

Identification

Level 5 files begin with the text string MATLAB 5.0 MAT-file. No such unique pattern exists for level 4. The MIME type of this format is unofficial, and it is used by Apache Tika

Specification

Software

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox