此为 Mathematica 8 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

MAT (.mat)

MATLAB MAT-files.
Matrix data format.
Native data format of the MATLAB numerical computation software.
Stores numerical matrices, Boolean values, or strings.
Binary format.
MAT Level 4 files are compatible with MATLAB Version 4 and lower, while MAT 5 files are compatible with MATLAB Version 5 and higher versions.
  • Import fully supports Versions 4 and 5 of the MAT format.
  • When appropriate, numerical data is imported as SparseArray objects.
  • Import imports a MAT-file, returning an array.
  • Export exports any numeric array to a MAT-file.
  • Import["file.mat"] returns a multidimensional array containing numbers, strings, or Boolean values.
  • Export["file.mat", expr] creates a MAT-file from an array of integers or doubles.
  • Import imports the specified element from a MAT-file.
  • Import imports multiple elements.
  • The import format can be specified with Import["file", "MAT"] or Import.
  • Export creates a MAT-file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements"list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties and settings
  • Data representation element:
"Data"numerical or textual data given as a multidimensional array
"LabeledData"data given as a list of rules
  • Meta-information element:
"Comments"user comments stored in the file
"Labels"dataset names given as a list of strings
This imports a simple MAT-file:
List available Import elements
Import raw meta-information from this file:
Export a numerical matrix:
Export a few named datasets and import the resulting file:
Export a named dataset using element specifications:
This imports a simple MAT-file:
In[1]:=
Click for copyable input
Out[1]=
 
List available Import elements
In[1]:=
Click for copyable input
Out[1]=
 
Import raw meta-information from this file:
In[1]:=
Click for copyable input
Out[1]=
 
Export a numerical matrix:
In[1]:=
Click for copyable input
Out[1]=
Export a few named datasets and import the resulting file:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Export a named dataset using element specifications:
In[1]:=
Click for copyable input
Out[1]=